From 5f26719d2d0d1c7216581e637a300b18b2d36ffd Mon Sep 17 00:00:00 2001 From: SmallCoccinelle <89733524+SmallCoccinelle@users.noreply.github.com> Date: Mon, 1 Nov 2021 01:16:23 +0100 Subject: [PATCH] Suppress a benign warning (#1932) --- pkg/api/routes_studio.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/api/routes_studio.go b/pkg/api/routes_studio.go index 67cb862dc..2cea188ec 100644 --- a/pkg/api/routes_studio.go +++ b/pkg/api/routes_studio.go @@ -2,8 +2,10 @@ package api import ( "context" + "errors" "net/http" "strconv" + "syscall" "github.com/go-chi/chi" "github.com/stashapp/stash/pkg/logger" @@ -47,7 +49,12 @@ func (rs studioRoutes) Image(w http.ResponseWriter, r *http.Request) { } if err := utils.ServeImage(image, w, r); err != nil { - logger.Warnf("error serving studio image: %v", err) + // Broken pipe errors are common when serving images and the remote + // connection closes the connection. Filter them out of the error + // messages, as they are benign. + if !errors.Is(err, syscall.EPIPE) { + logger.Warnf("cannot serve studio image: %v", err) + } } }