feat: log context cancelled error as warn instead of errors
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
This commit is contained in:
parent
382d17cc85
commit
69501f6302
@ -232,7 +232,12 @@ func (s *Server) handleDefault(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func (s *Server) handleError(w http.ResponseWriter, r *http.Request, status int, err error) {
|
||||
err = errors.WithStack(err)
|
||||
logger.Error(r.Context(), err.Error(), logger.CapturedE(err))
|
||||
|
||||
if errors.Is(err, context.Canceled) {
|
||||
logger.Warn(r.Context(), err.Error(), logger.CapturedE(err))
|
||||
} else {
|
||||
logger.Error(r.Context(), err.Error(), logger.CapturedE(err))
|
||||
}
|
||||
|
||||
s.renderErrorPage(w, r, err, status, http.StatusText(status))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user