Skip to content

Commit

Permalink
unfix the fix -> the condition prevent the error message from nodes t…
Browse files Browse the repository at this point in the history
…o be propagated

there was not issue here!
  • Loading branch information
billettc committed Dec 13, 2018
1 parent 531fce7 commit 2144359
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ func (api *API) call(baseAPI string, endpoint string, body interface{}, out inte
}
if resp.StatusCode > 299 {
var apiErr APIError
if err := json.Unmarshal(cnt.Bytes(), &apiErr); err == nil {
if err := json.Unmarshal(cnt.Bytes(), &apiErr); err != nil {
return fmt.Errorf("%s: status code=%d, body=%s", req.URL.String(), resp.StatusCode, cnt.String())
}
return apiErr
Expand Down

0 comments on commit 2144359

Please sign in to comment.