Skip to content

Commit

Permalink
Merge pull request #1916 from Netflix/fix-typed-graphql-error
Browse files Browse the repository at this point in the history
Convert execution aborted errors to a bad request.
  • Loading branch information
srinivasankavitha authored May 20, 2024
2 parents 89b2495 + 5b9d6a6 commit 67702c0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 67702c0

Please sign in to comment.