Ignoring when to wrap an error (#49)
Official 100go entry on adding context without destroying the ability to inspect the original failure.
Official 100go entry on adding context without destroying the ability to inspect the original failure.
- Author: Teiva Harsanyi
- Authority: community
- Kind: guide
- URL: https://100go.co/#ignoring-when-to-wrap-an-error-49
What it covers
- wrapping decisions
- contextual errors
- preserving machine-readable causes
Why authoritative
Official 100go website entry for this specific mistake.
Use when
- when should I wrap an error in Go
- should this return use %w
- how much context should I add to an error
Keywords
- error wrapping, %w, context, propagation, inspection