From c9c5b557212a7ffa6bef0e475bc6a951465e7ade Mon Sep 17 00:00:00 2001 From: DingDongSoLong4 <99329275+DingDongSoLong4@users.noreply.github.com> Date: Wed, 3 May 2023 05:28:23 +0200 Subject: [PATCH] Ignore graphql context canceled errors (#3689) --- internal/api/error.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/api/error.go b/internal/api/error.go index 85d9cde28..208b2521c 100644 --- a/internal/api/error.go +++ b/internal/api/error.go @@ -3,6 +3,7 @@ package api import ( "context" "encoding/json" + "errors" "github.com/99designs/gqlgen/graphql" "github.com/stashapp/stash/pkg/logger" @@ -13,7 +14,7 @@ func gqlErrorHandler(ctx context.Context, e error) *gqlerror.Error { // log all errors - for now just log the error message // we can potentially add more context later fc := graphql.GetFieldContext(ctx) - if fc != nil { + if fc != nil && !errors.Is(e, context.Canceled) { logger.Errorf("%s: %v", fc.Path(), e) // log the args in debug level