WithDetails now accepts optional pairs of keys and values as initial details.
Errorf supports multiple %w when used with Go 1.20 or newer.
StackFormatter which allows you to format stacks and marshal them to JSON.
Formatter which allows you to format errors (including ones not from this package)
and marshal them to JSON.
Error formatting accepts multiple flags to control the output, including #
flag to enable formatting of any details available on an error. It also accepts
width to control indentation and precision to control if formatting recurses and/or
uses error's fmt.Formatter implementation.
Support for Go 1.21.
StackTrace type alias for better compatibility with github.com/pkg/errors.
Unjoin function to find joined errors.
UnmarshalJSON to unmarshal JSON errors into placeholder errors which can then
be formatted in the same way as other errors from this package.
WithWrap function to set an error as a cause of the base error.
Changed
Formatting of errors has been changed so that %+v resembles
the formatting of github.com/pkg/errors while additional formatting flags
are necessary to obtain more verbose formatting previously done by this
package (e.g., - for human-friendly messages to delimit parts of the text,
' ' to add extra newlines to separate parts of the text better). You can
replace all %+v in your code with % +-.3v to obtain previous verbose formatting
and % #+-.3v if you want to include new support for formatting details.
#5#8
Error formatting now by default uses fmt.Formatter implementation of an error
only if the error does not implement interfaces used by this package (e.g.,
stackTracer or detailer). This is to assure consistent error formatting
when possible. You can change this default through format precision.
Details now unwraps the error to find the first one providing
details, only until an error with a cause or which
wraps multiple errors.
AllDetails collect details only until an error with a cause or which
wraps multiple errors.
JSON marshalling adds fields from error's details into JSON.
#7
Wrap and Wrapf return nil if provided error is nil.
Removed
Remove StackFormat and StackMarshalJSON in favor of StackFormatter.
WithDetails now accepts optional pairs of keys and values as initial details.
Errorf supports multiple %w when used with Go 1.20 or newer.
StackFormatter which allows you to format stacks and marshal them to JSON.
Formatter which allows you to format errors (including ones not from this package)
and marshal them to JSON.
Error formatting accepts multiple flags to control the output, including #
flag to enable formatting of any details available on an error. It also accepts
width to control indentation and precision to control if formatting recurses and/or
uses error's fmt.Formatter implementation.
Support for Go 1.21.
StackTrace type alias for better compatibility with github.com/pkg/errors.
Unjoin function to find joined errors.
UnmarshalJSON to unmarshal JSON errors into placeholder errors which can then
be formatted in the same way as other errors from this package.
WithWrap function to set an error as a cause of the base error.
Changed
Formatting of errors has been changed so that %+v resembles
the formatting of github.com/pkg/errors while additional formatting flags
are necessary to obtain more verbose formatting previously done by this
package (e.g., - for human-friendly messages to delimit parts of the text,
' ' to add extra newlines to separate parts of the text better). You can
replace all %+v in your code with % +-.3v to obtain previous verbose formatting
and % #+-.3v if you want to include new support for formatting details.
#5#8
Error formatting now by default uses fmt.Formatter implementation of an error
only if the error does not implement interfaces used by this package (e.g.,
stackTracer or detailer). This is to assure consistent error formatting
when possible. You can change this default through format precision.
Details now unwraps the error to find the first one providing
details, only until an error with a cause or which
wraps multiple errors.
AllDetails collect details only until an error with a cause or which
wraps multiple errors.
JSON marshalling adds fields from error's details into JSON.
#7
Wrap and Wrapf return nil if provided error is nil.
Removed
Remove StackFormat and StackMarshalJSON in favor of StackFormatter.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps gitlab.com/tozd/go/errors from 0.5.0 to 0.6.0.
Release notes
Sourced from gitlab.com/tozd/go/errors's releases.
Changelog
Sourced from gitlab.com/tozd/go/errors's changelog.
Commits
8457145
Release v0.6.0.025ded3
Better example.02ba656
More tests.2207210
Docs.dab14dc
Explain stack traces.68b0da3
Add join example.2ef30b1
List Join.de764ea
Mention return type.62be170
README.e22a7d8
Order.Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show