This PR includes a redacted copy of the verbose error printout in the Message field of Sentry reports.
This, arguably, was desirable from the beginning, but was impossible when the errors library was first designed, because at the time we did not have a reliable redaction library. Now that we have one, we can use it.
The main visible improvement resulting from this PR is the verbose (and tree-preserving) printout of the error hidden behind barriers (e.g. those included behind assertion failures). However, this change will also now include more details about other situations, such as:
known Go runtime errors (e.g. context canceled, os.PathError, etc)
custom error types that have a safe formatter function even though they don't report safe strings via the SafeDetails interface
the tree structure of secondary errors
(and more generally leverages the full power of the recently redesigned errors.FormatError code)
Informs https://github.com/cockroachdb/cockroach/issues/76571.
This PR includes a redacted copy of the verbose error printout in the Message field of Sentry reports.
This, arguably, was desirable from the beginning, but was impossible when the
errors
library was first designed, because at the time we did not have a reliable redaction library. Now that we have one, we can use it.The main visible improvement resulting from this PR is the verbose (and tree-preserving) printout of the error hidden behind barriers (e.g. those included behind assertion failures). However, this change will also now include more details about other situations, such as:
(and more generally leverages the full power of the recently redesigned errors.FormatError code)
For example, given the starting point Go code:
Example, before:![image](https://user-images.githubusercontent.com/642886/156786362-f08b3285-fc7d-4751-88ea-ab79c2aa1a52.png)
Example, after:![image](https://user-images.githubusercontent.com/642886/156792792-416c8c7c-e4ab-4359-a266-6b32f2e5450e.png)
This change is![Reviewable](https://reviewable.io/review_button.svg)