From 7d2b621bed73d43468c9acfad7399068bd3079f3 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Fri, 15 Sep 2023 17:50:39 +1000 Subject: [PATCH] fix: don't info-log uninteresting error message --- httpipfs.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/httpipfs.go b/httpipfs.go index 49818bc..9b22c10 100644 --- a/httpipfs.go +++ b/httpipfs.go @@ -6,6 +6,7 @@ import ( "fmt" "io" "net/http" + "strings" "sync" "time" @@ -98,7 +99,11 @@ func (hi *HttpIpfs) ServeHTTP(res http.ResponseWriter, req *http.Request) { } logger.Debugw("forcing unclean close", "cid", cs, "status", status, "err", err) if err := closeWithUnterminatedChunk(res); err != nil { - logger.Infow("unable to send early termination", "err", err) + log := logger.Infow + if strings.Contains(err.Error(), "use of closed network connection") { + log = logger.Debugw // it's just not as interesting in this case + } + log("unable to send early termination", "err", err) } return default: