Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
feat(warden): error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Sudheer Pal committed Oct 23, 2023
1 parent 4677041 commit 05abd06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions warden/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (c *Client) ListUserTeams(ctx context.Context, req TeamListRequest) ([]Team
return nil, fmt.Errorf("error reading response body: %w", err)
}
bodyString := string(bodyBytes)
return nil, errors.New(fmt.Errorf("got non-200 http status code=(%d) body=%s", resp.StatusCode, bodyString).Error())
return nil, errors.New(fmt.Sprintf("got non-200 http status code=(%d) body=%s", resp.StatusCode, bodyString))

Check failure on line 47 in warden/client.go

View workflow job for this annotation

GitHub Actions / golangci-lint

errorf: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (revive)

Check failure on line 47 in warden/client.go

View workflow job for this annotation

GitHub Actions / golangci-lint

errorf: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (revive)
}

var data teamListResponse
Expand Down Expand Up @@ -78,7 +78,7 @@ func (c *Client) TeamByUUID(ctx context.Context, req TeamByUUIDRequest) (*Team,
return nil, fmt.Errorf("error reading response body: %w", err)
}
bodyString := string(bodyBytes)
return nil, errors.New(fmt.Errorf("got non-200 http status code=(%d) body=%s", resp.StatusCode, bodyString).Error())
return nil, errors.New(fmt.Sprintf("got non-200 http status code=(%d) body=%s", resp.StatusCode, bodyString))

Check failure on line 81 in warden/client.go

View workflow job for this annotation

GitHub Actions / golangci-lint

errorf: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (revive)

Check failure on line 81 in warden/client.go

View workflow job for this annotation

GitHub Actions / golangci-lint

errorf: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (revive)
}

var data teamResponse
Expand Down

0 comments on commit 05abd06

Please sign in to comment.