Skip to content

v1.10.1 multi-cause error support without requiring go 1.20

Compare
Choose a tag to compare
@dhartunian dhartunian released this 24 Aug 22:09
· 27 commits to master since this release

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 and As 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

New Contributors

Full Changelog: v1.10.0...v1.11.0