Skip to content

Commit

Permalink
fix: don't info-log uninteresting error message
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Sep 15, 2023
1 parent 78764c2 commit 7d2b621
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion httpipfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"net/http"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7d2b621

Please sign in to comment.