GetErrorCode reads an error, which should be a type of APIError, and returns its status code. If the given "err" is nil or is not an APIError it returns 200, acting as we have no error.
(err error)
| 76 | // If the given "err" is nil or is not an APIError it returns 200, |
| 77 | // acting as we have no error. |
| 78 | func GetErrorCode(err error) int { |
| 79 | apiErr, ok := GetError(err) |
| 80 | if !ok { |
| 81 | return http.StatusOK |
| 82 | } |
| 83 | |
| 84 | return apiErr.Response.StatusCode |
| 85 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…