Skip to content

Commit

Permalink
fix: set rate limit log level to warn (supabase#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangmingtay authored and LashaJini committed Nov 13, 2024
1 parent bf2d0f6 commit a172bf2
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 a172bf2

Please sign in to comment.