WithMessage annotates err with a new message. If err is nil, WithMessage returns nil. The message is considered safe for reporting and is included in Sentry reports.
(err error, message string)
| 21 | // The message is considered safe for reporting |
| 22 | // and is included in Sentry reports. |
| 23 | func WithMessage(err error, message string) error { |
| 24 | if err == nil { |
| 25 | return nil |
| 26 | } |
| 27 | return &withPrefix{ |
| 28 | cause: err, |
| 29 | prefix: redact.Sprint(redact.Safe(message)), |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | // WithMessagef annotates err with the format specifier. |
| 34 | // If err is nil, WithMessagef returns nil. |
no outgoing calls
no test coverage detected
searching dependent graphs…