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
IsandAssupport is now compatible with multi-cause errors (matching stdlib changes)
The public API gains a number of new functions
See the README for details.
Joinadds 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 https://github.com/cockroachdb/errors/pull/116
- support wrapError encode and decode by @dhartunian in https://github.com/cockroachdb/errors/pull/113
- support multi-cause errors in go 1.20 by @dhartunian in https://github.com/cockroachdb/errors/pull/112
- add formatting for multi-cause errors by @dhartunian in https://github.com/cockroachdb/errors/pull/115
- Add Go 1.20 errors.Join support by @StevenACoffman in https://github.com/cockroachdb/errors/pull/118
- Add multi-cause unwrap into Sentry reporting by @dhartunian in https://github.com/cockroachdb/errors/pull/119
- update README with new public API changes by @dhartunian in https://github.com/cockroachdb/errors/pull/120
- Upgrade to go 1.20 and add multi-cause error support by @dhartunian in https://github.com/cockroachdb/errors/pull/121
New Contributors
- @omarkohl made their first contribution in https://github.com/cockroachdb/errors/pull/116
Full Changelog: https://github.com/cockroachdb/errors/compare/v1.10.0...v1.11.0