Error returns the error message with prefix if set.
()
| 79 | |
| 80 | // Error returns the error message with prefix if set. |
| 81 | func (e *WrappedError) Error() string { |
| 82 | if len(e.prefix) > 0 { |
| 83 | return e.prefix + ": " + e.error.Error() |
| 84 | } |
| 85 | return e.error.Error() |
| 86 | } |
| 87 | |
| 88 | // Unwrap returns the wrapped error. |
| 89 | func (e *WrappedError) Unwrap() error { |