Error formats the error for printing. If a custom Status is provided, it is returned as-is, otherwise it generates a generic error-message based on the StatusCode.
()
| 11 | // it is returned as-is, otherwise it generates a generic error-message |
| 12 | // based on the StatusCode. |
| 13 | func (e StatusError) Error() string { |
| 14 | if e.Status != "" { |
| 15 | return e.Status |
| 16 | } |
| 17 | if e.Cause != nil { |
| 18 | return e.Cause.Error() |
| 19 | } |
| 20 | // we don't want to set a default message here, |
| 21 | // some commands might want to be explicit about the error message |
| 22 | return "" |
| 23 | } |
| 24 | |
| 25 | func (e StatusError) Unwrap() error { |
| 26 | return e.Cause |
no outgoing calls