Skip to content

Commit 3c087ca

Browse files
authored
Don't print on errors. (ktrysmt#209)
Don't print on errors so consumers of the library can control what they show to the users.
1 parent c71e70f commit 3c087ca

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

client.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,7 @@ func (c *Client) doRequest(req *http.Request, emptyResponse bool) (interface{},
331331

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

389388
var result interface{}
390389
if err := json.Unmarshal(responseBytes, &result); err != nil {
391-
log.Println("Could not unmarshal JSON payload, returning raw response")
392390
return resBody, err
393391
}
394392
return result, nil

0 commit comments

Comments
 (0)