(resp *http.Response, result interface{})
| 1589 | } |
| 1590 | |
| 1591 | func (c *Client) handleResponse(resp *http.Response, result interface{}) error { |
| 1592 | if resp.StatusCode >= 400 { |
| 1593 | return c.parseError(resp) |
| 1594 | } |
| 1595 | if result != nil { |
| 1596 | return json.NewDecoder(resp.Body).Decode(result) |
| 1597 | } |
| 1598 | return nil |
| 1599 | } |
| 1600 | |
| 1601 | func (c *Client) parseError(resp *http.Response) error { |
| 1602 | var errResp struct { |
no test coverage detected