Extract unwraps and returns the user error if it exists.
(err error)
| 76 | |
| 77 | // Extract unwraps and returns the user error if it exists. |
| 78 | func Extract(err error) (error, bool) { // nolint: revive |
| 79 | c := &combined{} |
| 80 | if errors.As(err, &c) { |
| 81 | return c, true |
| 82 | } |
| 83 | return nil, false |
| 84 | } |
| 85 | |
| 86 | // ShouldLogError returns true if the it's a combined error specifically marked to be logged |
| 87 | // or if it's not an ExitError. |
no outgoing calls
no test coverage detected