(statusCode int, code string, description string)
| 25 | } |
| 26 | |
| 27 | func NewHTTPError(statusCode int, code string, description string) error { |
| 28 | err := baseHTTPError{ |
| 29 | statusCode: statusCode, |
| 30 | apiErrorCode: code, |
| 31 | description: description, |
| 32 | } |
| 33 | switch statusCode { |
| 34 | case 404: |
| 35 | return &HTTPNotFoundError{err} |
| 36 | default: |
| 37 | return &err |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | func (err *baseHTTPError) StatusCode() int { |
| 42 | return err.statusCode |
no outgoing calls
no test coverage detected