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
barriers: reveal more safe details about the masked error
This commit extracts more safe details for the error hidden behind a
barrier. It achieves this using the new `SafeFormatError()` API via
the `redact` package.
As a side effect, this guarantees that a sentry report for a
barrier (including, but not limited to, assertion failures constructed
with errors.NewAssertionErrorWithWrappedErrf) now always spells out
the type of the error behind the barrier. It also includes any
safe-for-reporting strings that the hidden error object would report
when printed out via `%+v`.
Note that this patch is a band-aid: this is really adding more
complexity to the `SafeDetails()` API, which is arguably somewhat
obsolete now that the `errors` and `redact` packages collaborate to
extract safe strings. However, there is some marginal utility
remaining, in the particular case of an error object transported over
the wire where the target server doesn't know how to decode the error
behind the barrier; in this case, the approach taken here ensures that
a modicum of reportable structure is still included.
0 commit comments