Skip to content

v1.11.0 go 1.20 compatibility and multi-cause error support

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

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