Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Apply review feedback
Browse files Browse the repository at this point in the history
Co-authored-by: Leandro López <[email protected]>
  • Loading branch information
joanlopez and inkel committed Oct 4, 2023
1 parent 7779aab commit 110dc04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ func (c *Client) request(method, requestPath string, query url.Values, body []by
switch {
case resp.StatusCode == http.StatusNotFound:
return ErrNotFound{
StatusCode: resp.StatusCode,
BodyContents: bodyContents,
}
case resp.StatusCode >= 400:
Expand Down
4 changes: 2 additions & 2 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package gapi
import "fmt"

type ErrNotFound struct {
StatusCode int
BodyContents []byte
}

func (e ErrNotFound) Error() string {
return fmt.Sprintf("status: %d, body: %v", e.StatusCode, string(e.BodyContents))
return fmt.Sprintf("status: 404, body: %s", e.BodyContents)

}

0 comments on commit 110dc04

Please sign in to comment.