-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
11 changed files
with
706 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.