Skip to content

Commit

Permalink
Log connection reset by peer as debug-level
Browse files Browse the repository at this point in the history
  • Loading branch information
milesbxf committed Oct 22, 2021
1 parent b4d9c19 commit a72ed11
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion http.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ func isStreamingRsp(rsp Response) bool {
func copyErrSeverity(err error) slog.Severity {

switch {
case strings.HasSuffix(err.Error(), "read on closed response body"):
case strings.HasSuffix(err.Error(), "read on closed response body"),
strings.HasSuffix(err.Error(), "connection reset by peer"):
return slog.DebugSeverity
}

Expand Down

0 comments on commit a72ed11

Please sign in to comment.