mirror of
https://github.com/livekit/livekit.git
synced 2026-03-29 11:29:52 +00:00
skip http request logging when the client aborts the request (#3195)
* skip http request logging when the client aborts the request * cleanup
This commit is contained in:
@@ -31,7 +31,7 @@ func handleError(w http.ResponseWriter, r *http.Request, status int, err error,
|
||||
if r != nil && r.URL != nil {
|
||||
keysAndValues = append(keysAndValues, "method", r.Method, "path", r.URL.Path)
|
||||
}
|
||||
if !errors.Is(err, context.Canceled) {
|
||||
if !errors.Is(err, context.Canceled) && !errors.Is(r.Context().Err(), context.Canceled) {
|
||||
logger.GetLogger().WithCallDepth(1).Warnw("error handling request", err, keysAndValues...)
|
||||
}
|
||||
w.WriteHeader(status)
|
||||
|
||||
Reference in New Issue
Block a user