v1.10.1 multi-cause error support without requiring go 1.20
This release is identical to v1.11.0 except that it remains compatible with pre 1.20 go versions. This allows for rolling out support in your system in a backwards compatible manner, allowing applications that are not using go 1.20 to decode and interpret multi-cause errors generated by newer versions of this library.
This release adds support for go 1.20 and its multi-cause errors introduced into the errors API.
Multi-cause errors are now supported
These were introduced in go 1.20
- Errors with multiple causes are encoded/decoded over the network along with their error causal tree
- Errors with multiple causes are formatted appropriately when printed verbosely
- Errors with multiple causes are formatted appropriately in Sentry reports
Is
andAs
support is now compatible with multi-cause errors (matching stdlib changes)
The public API gains a number of new functions
See the README for details.
Join
adds a drop-in replacement for the new stdlib function to combine an arbitrary number of errors into one (Thank you @StevenACoffman)- Ability to register multi-cause encoders/decoders for custom error types
- Ability to register encoders for custom error types that override the error messages of their causal chain (previously, this behavior was inferred in the decoder and could result in unintended formatting behavior)
A bug was fixed in the formatting of wrapped errors that resulted in only the innermost cause getting printed (#113)
What's Changed
- Document intended differences between WithHint and WithDetail (#114) by @omarkohl in #116
- support wrapError encode and decode by @dhartunian in #113
- support multi-cause errors in go 1.20 by @dhartunian in #112
- add formatting for multi-cause errors by @dhartunian in #115
- Add Go 1.20 errors.Join support by @StevenACoffman in #118
- Add multi-cause unwrap into Sentry reporting by @dhartunian in #119
- update README with new public API changes by @dhartunian in #120
- Upgrade to go 1.20 and add multi-cause error support by @dhartunian in #121
New Contributors
Full Changelog: v1.10.0...v1.11.0