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)
| 34 | // - when formatting with `%+v`. |
| 35 | // - in Sentry reports. |
| 36 | func 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 |
searching dependent graphs…