GetAPIErrorCode returns 0 if an error is not an APIError, or the result of the Code() method from an APIError
(e error)
| 251 | // GetAPIErrorCode returns 0 if an error is not an APIError, or the result |
| 252 | // of the Code() method from an APIError |
| 253 | func GetAPIErrorCode(e error) int { |
| 254 | err, ok := e.(APIError) |
| 255 | if ok { |
| 256 | return err.Code() |
| 257 | } |
| 258 | return 0 |
| 259 | } |
| 260 | |
| 261 | // FuncError is an error that is the function's fault, that uses the |
| 262 | // APIError but distinguishes fault to function specific errors |