Documentation
¶
Overview ¶
Package errwrap wraps errors with additional context and walks chains of wrapped errors.
This is a yoke clean-room implementation written for S488.3c (remove the MPL-2.0 hashicorp/errwrap dependency from the engine build). Nothing in the yoke engine graph imports errwrap directly — it was only reached through go-multierror, which this repository now replaces with external/multierror. The module exists so the hashicorp/errwrap module path resolves to permissive code for consumers that pin it alongside the multierror replacement. The surface is the small wrapping/walking core, designed from the standard library error-wrapping conventions (fmt.Errorf with %w, errors.Is/As traversal); the replaced module's source was never read.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns the first error in err's chain that is equal to target (per errors.Is), or nil when there is no match.
func Walk ¶
Walk descends err through its Unwrap chain (both the single-error and []error forms), calling fn for err itself and every wrapped error beneath it. It stops descending a branch once fn returns false, and returns the first error fn itself returns, if any.
Types ¶
This section is empty.