Error is a web response error. Use this when API calls don't work out like you wanted them to.
| 34 | |
| 35 | // Error is a web response error. Use this when API calls don't work out like you wanted them to. |
| 36 | type Error struct { |
| 37 | WantStatus, GotStatus int |
| 38 | URL *url.URL |
| 39 | Method string |
| 40 | ResponseBody string |
| 41 | } |
| 42 | |
| 43 | func (e Error) Error() string { |
| 44 | return fmt.Sprintf("%s %s: wanted status code %d, got: %d: %v", e.Method, e.URL, e.WantStatus, e.GotStatus, e.ResponseBody) |
nothing calls this directly
no outgoing calls
no test coverage detected