Skip to content

Commit

Permalink
Don't print on errors. (#209)
Browse files Browse the repository at this point in the history
Don't print on errors so consumers of the library can control what they
show to the users.
  • Loading branch information
bfabio authored Jun 18, 2022
1 parent c71e70f commit 3c087ca
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,7 @@ func (c *Client) doRequest(req *http.Request, emptyResponse bool) (interface{},

var result interface{}
if err := json.Unmarshal(responseBytes, &result); err != nil {
log.Println("Could not unmarshal JSON payload, returning raw response")
return responseBytes, nil
return responseBytes, err
}
return result, nil
}
Expand Down Expand Up @@ -388,7 +387,6 @@ func (c *Client) doPaginatedRequest(req *http.Request, emptyResponse bool) (inte

var result interface{}
if err := json.Unmarshal(responseBytes, &result); err != nil {
log.Println("Could not unmarshal JSON payload, returning raw response")
return resBody, err
}
return result, nil
Expand Down

0 comments on commit 3c087ca

Please sign in to comment.