Suppress a benign warning (#1932)

This commit is contained in:
SmallCoccinelle 2021-11-01 01:16:23 +01:00 committed by GitHub
parent 0d24af4cb4
commit 5f26719d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -2,8 +2,10 @@ package api
import ( import (
"context" "context"
"errors"
"net/http" "net/http"
"strconv" "strconv"
"syscall"
"github.com/go-chi/chi" "github.com/go-chi/chi"
"github.com/stashapp/stash/pkg/logger" "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 { 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)
}
} }
} }