MCPcopy Create free account
hub / github.com/cockroachdb/errors / Handled

Function Handled

barriers/barriers.go:36–41  ·  view source on GitHub ↗

Handled swallows the provided error and hides it from the Cause()/Unwrap() interface, and thus the Is() facility that identifies causes. However, it retains it for the purpose of printing the error out (e.g. for troubleshooting). The error message is preserved in full. Detail is shown: - via `error

(err error)

Source from the content-addressed store, hash-verified

34// - when formatting with `%+v`.
35// - in Sentry reports.
36func Handled(err error) error {
37 if err == nil {
38 return nil
39 }
40 return HandledWithSafeMessage(err, redact.Sprint(err))
41}
42
43// HandledWithMessage is like Handled except the message is overridden.
44// This can be used e.g. to hide message details or to prevent

Callers 9

OpaqueFunction · 0.92
HandledFunction · 0.92
TestHideCauseFunction · 0.92
TestBarrierMessageFunction · 0.92
TestFormatFunction · 0.92
HandledInDomainFunction · 0.92
datadriven_test.goFile · 0.92

Calls 1

HandledWithSafeMessageFunction · 0.85

Tested by 3

TestHideCauseFunction · 0.74
TestBarrierMessageFunction · 0.74
TestFormatFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…