Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
udsamani committed Sep 11, 2024
1 parent c7a7dde commit 2df4031
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/publicapi/apimodels/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func FromHttpResponse(resp *http.Response) (*APIError, error) {

body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("error reading response body: %w")
return nil, fmt.Errorf("error reading response body: %w", err)
}

var apiErr APIError
Expand Down
4 changes: 3 additions & 1 deletion pkg/publicapi/middleware/error_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ func CustomHTTPErrorHandler(err error, c echo.Context) {

case *echo.HTTPError:
// This is needed, in case any other middleware throws an error. In
// such a scenario we just use it as the error code.
// such a scenario we just use it as the error code and the message.
// One such example being when request body size is larger then the max
// size accepted
code = e.Code
message = e.Message.(string)

Expand Down

0 comments on commit 2df4031

Please sign in to comment.