Skip to content

Commit

Permalink
Tweak client error response to prefix status code
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Feb 4, 2020
1 parent a828c19 commit 240bebd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (c *Client) doHTTPReq(method, rURI string, reqBody interface{}, headers htt
if err := json.Unmarshal(body, &resp); err != nil {
return fmt.Errorf("error unmarshaling JSON response: %v", err)
}
return errors.New(resp.Message)
return fmt.Errorf("%d: %s", r.StatusCode, resp.Message)
}

return nil
Expand Down

0 comments on commit 240bebd

Please sign in to comment.