APIError is a structured error that every API handler should return for consistency in logging and client responses. If Message is unset, then Err.Error() will be serialized in its place.
| 1374 | // and client responses. If Message is unset, then |
| 1375 | // Err.Error() will be serialized in its place. |
| 1376 | type APIError struct { |
| 1377 | HTTPStatus int `json:"-"` |
| 1378 | Err error `json:"-"` |
| 1379 | Message string `json:"error"` |
| 1380 | } |
| 1381 | |
| 1382 | func (e APIError) Error() string { |
| 1383 | if e.Err != nil { |
nothing calls this directly
no outgoing calls
no test coverage detected