Error represents an error that originates from the API, i.e. when a request is made and the API returns a response with a HTTP status code. Other errors are not wrapped by this SDK.
| 15 | // made and the API returns a response with a HTTP status code. Other errors are |
| 16 | // not wrapped by this SDK. |
| 17 | type Error struct { |
| 18 | Code string `json:"code" api:"required"` |
| 19 | Message string `json:"message" api:"required"` |
| 20 | Param string `json:"param" api:"required"` |
| 21 | Type string `json:"type" api:"required"` |
| 22 | // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. |
| 23 | JSON struct { |
| 24 | Code respjson.Field |
| 25 | Message respjson.Field |
| 26 | Param respjson.Field |
| 27 | Type respjson.Field |
| 28 | ExtraFields map[string]respjson.Field |
| 29 | raw string |
| 30 | } `json:"-"` |
| 31 | StatusCode int |
| 32 | Request *http.Request |
| 33 | Response *http.Response |
| 34 | } |
| 35 | |
| 36 | // Returns the unmodified JSON received from the API |
| 37 | func (r Error) RawJSON() string { return r.JSON.raw } |
nothing calls this directly
no outgoing calls
no test coverage detected