Skip to content

Commit

Permalink
Fix status code not available
Browse files Browse the repository at this point in the history
  • Loading branch information
haritsfahreza committed Aug 2, 2018
1 parent a9bde1b commit 66dac4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ func (c *Client) ExecuteRequest(req *http.Request, v interface{}) error {
}

if v != nil {
return json.Unmarshal(resBody, v)
if err = json.Unmarshal(resBody, v); err != nil {
return err
}
v.(map[string]interface{})["status_code"] = string(res.StatusCode)
}

return nil
Expand Down

0 comments on commit 66dac4d

Please sign in to comment.