Error returns the human-readable message. When constructed from an underlying error without an explicit message, it falls back to that error's text so existing message-based assertions keep passing.
()
| 53 | // underlying error without an explicit message, it falls back to that error's |
| 54 | // text so existing message-based assertions keep passing. |
| 55 | func (e *Error) Error() string { |
| 56 | if e.msg != "" { |
| 57 | return e.msg |
| 58 | } |
| 59 | if e.err != nil { |
| 60 | return e.err.Error() |
| 61 | } |
| 62 | return "service error" |
| 63 | } |
| 64 | |
| 65 | // Unwrap exposes the underlying cause for errors.Is / errors.As. |
| 66 | func (e *Error) Unwrap() error { return e.err } |
no outgoing calls