Skip to content

Commit

Permalink
chore: improve err handling for non-json responses #153
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Nov 15, 2023
1 parent 665fa97 commit b3f0745
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/apiclient/httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func PrettifyJson(body []byte) (prettyJson []byte, err error) {
prettyJSON := bytes.Buffer{}
err = json.Indent(&prettyJSON, body, "", "\t")
if err != nil {
clilog.Error.Println("error parsing response: ", err)
clilog.Error.Printf("error parsing json response: %v, the original response was: %s\n", err, string(body))

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by an access to passphrase
flows to a logging call.
return nil, err
}
return prettyJSON.Bytes(), err
Expand Down

0 comments on commit b3f0745

Please sign in to comment.