| Conditions | 2 |
| Total Lines | 10 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 2.0625 |
| Changes | 0 | ||
| 1 | package devto |
||
| 19 | func unmarshalErrorResponse(res *http.Response) error { |
||
| 20 | 1 | var e ErrorResponse |
|
| 21 | 1 | if err := json.NewDecoder(res.Body).Decode(&e); err != nil { |
|
| 22 | return fmt.Errorf( |
||
| 23 | `unexpected error deserializing %d response: "%v"`, |
||
| 24 | res.StatusCode, |
||
| 25 | err, |
||
| 26 | ) |
||
| 27 | } |
||
| 28 | 1 | return &e |
|
| 29 | } |
||
| 39 |