From a083f6e9e19fe5b00801cbd341c650151c0b0215 Mon Sep 17 00:00:00 2001 From: "$(git --no-pager log --format=format:'%an' -n 1)" Date: Mon, 20 May 2024 13:22:24 -0700 Subject: [PATCH] Convert execution aborted errors to a bad request. --- .../graphql/dgs/internal/GraphQLJavaErrorInstrumentation.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/internal/GraphQLJavaErrorInstrumentation.kt b/graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/internal/GraphQLJavaErrorInstrumentation.kt index 5d326dd0c..36e70ab4b 100644 --- a/graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/internal/GraphQLJavaErrorInstrumentation.kt +++ b/graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/internal/GraphQLJavaErrorInstrumentation.kt @@ -27,7 +27,8 @@ class GraphQLJavaErrorInstrumentation : SimplePerformantInstrumentation() { } if (error.errorType == graphql.ErrorType.ValidationError || error.errorType == graphql.ErrorType.InvalidSyntax || - error.errorType == graphql.ErrorType.NullValueInNonNullableField || error.errorType == graphql.ErrorType.OperationNotSupported + error.errorType == graphql.ErrorType.NullValueInNonNullableField || error.errorType == graphql.ErrorType.OperationNotSupported || + error.errorType == graphql.ErrorType.ExecutionAborted ) { val path = if (error is ValidationError) error.queryPath else error.path val graphqlErrorBuilder = TypedGraphQLError @@ -49,7 +50,7 @@ class GraphQLJavaErrorInstrumentation : SimplePerformantInstrumentation() { graphqlErrorBuilder.errorDetail(ErrorDetail.Common.INVALID_ARGUMENT) } graphqlErrors.add(graphqlErrorBuilder.build()) - } else if (error.errorType == graphql.ErrorType.DataFetchingException || error.errorType == graphql.ErrorType.ExecutionAborted) { + } else if (error.errorType == graphql.ErrorType.DataFetchingException) { val graphqlErrorBuilder = TypedGraphQLError .newBuilder() .errorType(ErrorType.INTERNAL)