v1.7.0: New error redaction logic, and more! (API CHANGE)
The main change in this release is a radical change in how the library internally learns about and treats strings to separate "safe" and "unsafe" information.
Despite the major version bump, only very few APIs have been changed in a backward-incompatible way.
Also, no new strings are considered safe for reporting that were not already before, unlike what happened in v1.6.0.
(For context, "safe" means known not to contain PII, confidential data etc, and thus safe to report to Sentry and other telemetry.)
Highlights
- More complete error messages in Sentry reports,
- More details of errors are preserved when they are embedded inside other errors.
- Several bug fixes in error formatting.
- A more complete test suite to test error formatting and sentry reports.
Backward-incompatible changes
- The
errors.Safe()function now returns aredact.SafeValue, instead of anerrors.SafeMessageras before.
Major changes
-
A new interface
errors.SafeFormatteris introduced, and should be preferred toerrors.Formatterin the general case. -
Prior to this release, the only safe strings were error types and the explicit "Safe Details" payloads as implemented by the
SafeDetailerinterface,errors.WithSafeDetails()and the implicit capture of detail strings byerrors.New*()anderrors.Wrap*()constructors.This machinery has been complemented by the new package https://github.com/cockroachdb/redact (previously introduced in CockroachDB) which is now used throughout the library for error redaction.
The
SafeDetailerinterface and corresponding safe strings are still supported (and reported in Sentry if found). Backward-compatible safe detail strings are also generated by the new redact-based code for the benefit of networked code using mixed library versions.