You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make New() and Wrap() consider their string as PII-free
**THIS IS A BREAKING CHANGE.**
The `errors.New()`, `errors.NewWithDepth()`, `errors.Wrap()` and
`errors.WrapWithDepth()` now consider their string argument as
PII-free, and the string is now also included in Sentry reports.
This is a breaking change: in previous versions, only the format
argument to `errors.Newf`, `errors.Wrapf` etc was considered to be
PII-free.
This also means that **care must be taken when using this `errors`
library as drop-in replacement for other errors libraries**: callers
that use `New()` and `Wrap()` directly must be audited to ensure that
they indeed pass strings that are safe for reporting to Sentry.
This can be enforced e.g. via linters that assert that the argument is
a literal (constant) string. This is the approach taken e.g. in
CockroachDB.
- what it does: also captures the stack trace at point of call and redacts the provided message for safe reporting.
101
-
- how to access the detail: `Error()`, regular Go formatting. Details redacted in Sentry report.
101
+
- how to access the detail: `Error()`, regular Go formatting. **Details in Sentry report.**
102
102
- see also: Section [Error composition](#Error-composition-summary) below. `errors.NewWithDepth()` variants to customize at which call depth the stack trace is captured.
- what it does: combines `WithMessage()`, `WithStack()`, `WithSafeDetails()`.
144
-
- how to access the details: `Error()`, regular Go formatting. Details redacted in Sentry report.
144
+
- how to access the details: `Error()`, regular Go formatting. **Details in Sentry report.**
145
145
- see also: Section [Error composition](#Error-composition-summary) below. `WrapWithDepth()` variants to customize at which depth the stack trace is captured.
146
146
147
147
-`WithSecondaryError(error, error) error`: annotate an error with a secondary error.
0 commit comments