Skip to content

Commit

Permalink
Merge pull request #143 from wot-oss/chore/remote-http-err-logging
Browse files Browse the repository at this point in the history
chore: baseHttpRepo: add logging of error responses from remote
  • Loading branch information
enricoschuetz authored Jan 13, 2025
2 parents af91e1c + 25cc118 commit d41224b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/repos/http_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ func (b *baseHttpRepo) doHttp(req *http.Request) (*http.Response, error) {

resp, err := b.client.Do(req)
if err != nil {
utils.GetLogger(req.Context(), "HttpRepo").Error(err.Error())
utils.GetLogger(req.Context(), "baseHttpRepo").Error(err.Error())
}
if resp.StatusCode >= http.StatusBadRequest {
utils.GetLogger(req.Context(), "baseHttpRepo").Error("received error response from remote", "status", resp.StatusCode)
}
return resp, err
}
Expand Down

0 comments on commit d41224b

Please sign in to comment.