GetError reports whether the given "err" is an APIError.
(err error)
| 49 | |
| 50 | // GetError reports whether the given "err" is an APIError. |
| 51 | func GetError(err error) (APIError, bool) { |
| 52 | if err == nil { |
| 53 | return APIError{}, false |
| 54 | } |
| 55 | |
| 56 | apiErr, ok := err.(APIError) |
| 57 | if !ok { |
| 58 | return APIError{}, false |
| 59 | } |
| 60 | |
| 61 | return apiErr, true |
| 62 | } |
| 63 | |
| 64 | // DecodeError binds a json error to the "destPtr". |
| 65 | func DecodeError(err error, destPtr interface{}) error { |
no outgoing calls
no test coverage detected
searching dependent graphs…