Skip to content

Commit

Permalink
Merge pull request nutanix#192 from nutanix/fix-client
Browse files Browse the repository at this point in the history
fix: missing variable initialization
  • Loading branch information
marinsalinas authored Nov 23, 2020
2 parents 118fa26 + 64fb150 commit 5e2b9f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,12 @@ func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) error

// CheckResponse checks errors if exist errors in request
func CheckResponse(r *http.Response) error {
if c := r.StatusCode; c >= 200 && c <= 299 {
c := r.StatusCode

if c >= 200 && c <= 299 {
return nil
}

// Nutanix returns non-json response with code 401 when
// invalid credentials are used
if c == 401 {
Expand Down

0 comments on commit 5e2b9f9

Please sign in to comment.