From 7b37b94d299ec78100c332739aaf9863a7db3817 Mon Sep 17 00:00:00 2001 From: milesbryant Date: Mon, 9 May 2022 15:33:35 +0100 Subject: [PATCH] Log http2: stream closed as debug-level These errors occur as a result of the client closing the stream as we're still writing to it, which is a frequent and expected part of HTTP/2 operation, so we can safely log these at debug level. --- http.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http.go b/http.go index fe9e38c6..6143c005 100644 --- a/http.go +++ b/http.go @@ -66,7 +66,8 @@ func copyErrSeverity(err error) slog.Severity { switch { case strings.HasSuffix(err.Error(), "read on closed response body"), - strings.HasSuffix(err.Error(), "connection reset by peer"): + strings.HasSuffix(err.Error(), "connection reset by peer"), + strings.HasSuffix(err.Error(), "http2: stream closed"): return slog.DebugSeverity }