Error returns the public error message.
()
| 69 | |
| 70 | // Error returns the public error message. |
| 71 | func (e *ToolError) Error() string { |
| 72 | if e == nil { |
| 73 | return nilErrorText |
| 74 | } |
| 75 | if e.Message != "" { |
| 76 | return e.Message |
| 77 | } |
| 78 | if e.Err != nil { |
| 79 | return e.Err.Error() |
| 80 | } |
| 81 | return string(e.Code) |
| 82 | } |
| 83 | |
| 84 | // Unwrap returns the wrapped cause. |
| 85 | func (e *ToolError) Unwrap() error { |
no outgoing calls