diff --git a/pkg/handler/error.go b/pkg/handler/error.go index d0d5498..4bc5d09 100644 --- a/pkg/handler/error.go +++ b/pkg/handler/error.go @@ -105,11 +105,10 @@ func (s *Standalone) respondError(w http.ResponseWriter, r *http.Request, status return } - if level == log.WarnLevel || errors.Is(cause, context.Canceled) { - logger.Warnf(msg, cause) - } else { - logger.Errorf(msg, cause) + if errors.Is(cause, context.Canceled) { + level = log.WarnLevel } + logger.Logf(level, msg, cause) logger.Infof("errorhandler: maximum retry attempts exceeded; executing error template...") span.SetAttributes(attribute.Bool("error.retries_exhausted", true))