Skip to content

Commit

Permalink
print response if fail to unmarshal error (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickmister authored Apr 13, 2023
1 parent 8601bf2 commit f1a4aa0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/remote/msgraph/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,8 @@ func (c *client) call(method, path, contentType string, inBody io.Reader, out in
errResp := msgraph.ErrorResponse{Response: resp}
err = json.Unmarshal(responseData, &errResp)
if err != nil {
return responseData, errors.WithMessagef(err, "status: %s", resp.Status)
}
if err != nil {
return responseData, err
return responseData, errors.WithMessagef(err, "status: %s. response: %s", resp.Status, string(responseData))
}

return responseData, &errResp
}

0 comments on commit f1a4aa0

Please sign in to comment.