pkg / errors

Simple error handling primitives
https://godoc.org/github.com/pkg/errors
BSD 2-Clause "Simplified" License
8.18k stars 691 forks source link

Support Go 1.13 error chains in `Cause` #215

Closed jayschwa closed 4 years ago

jayschwa commented 4 years ago

Imagine module A imports module B and both use pkg/errors. A uses errors.Cause to inspect wrapped errors returned from B. As-is, B cannot migrate from errors.Wrap to fmt.Errorf("%w", err) because that would break errors.Cause calls in A. With this change merged, errors.Cause becomes forwards-compatible with Go 1.13 error chains. Module B will be free to switch to fmt.Errorf("%w", err) and that will not break module A (so long as the top-level project pulls in the newer version of pkg/errors).

aperezg commented 4 years ago

@jayschwa If I'm not wrong you're agree with the changes propose for @puellanivis so, could you do this changes, to try unblock this PR, thanks :)

jayschwa commented 4 years ago

Pushed some changes: