Skip to content

Commit

Permalink
fix: set rate limit log level to warn (#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangmingtay authored Jul 11, 2024
1 parent 33caaa9 commit 10ca9c8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/api/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,14 @@ func HandleResponseError(err error, w http.ResponseWriter, r *http.Request) {
}

case *HTTPError:
if e.HTTPStatus >= http.StatusInternalServerError {
switch {
case e.HTTPStatus >= http.StatusInternalServerError:
e.ErrorID = errorID
// this will get us the stack trace too
log.WithError(e.Cause()).Error(e.Error())
} else {
case e.HTTPStatus == http.StatusTooManyRequests:
log.WithError(e.Cause()).Warn(e.Error())
default:
log.WithError(e.Cause()).Info(e.Error())
}

Expand Down

0 comments on commit 10ca9c8

Please sign in to comment.