(source error, msg string, args ...any)
| 64 | } |
| 65 | |
| 66 | func WithLoggedUserMessage(source error, msg string, args ...any) error { |
| 67 | if source == nil || hasUserMessage(source) { |
| 68 | return source |
| 69 | } |
| 70 | return &combined{ |
| 71 | logged: true, |
| 72 | source: source, |
| 73 | userMessage: fmt.Sprintf(msg, args...), |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | // Extract unwraps and returns the user error if it exists. |
| 78 | func Extract(err error) (error, bool) { // nolint: revive |
no test coverage detected