Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 288899b

Browse files
committed
fix(#605): keep custom error response
1 parent 6bb1e77 commit 288899b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

graphql-kickstart-spring-support/src/main/java/graphql/kickstart/spring/error/GraphQLErrorFromExceptionHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import graphql.GraphqlErrorBuilder;
99
import graphql.SerializationError;
1010
import graphql.kickstart.execution.error.DefaultGraphQLErrorHandler;
11-
import graphql.kickstart.execution.error.GenericGraphQLError;
1211
import java.util.Collection;
1312
import java.util.HashMap;
1413
import java.util.List;
@@ -42,7 +41,7 @@ private Collection<GraphQLError> transform(GraphQLError error) {
4241
error.getLocations(), error.getPath(), error.getExtensions(), error.getErrorType());
4342
return extractException(error)
4443
.map(throwable -> transform(throwable, errorContext))
45-
.orElse(singletonList(new GenericGraphQLError(error.getMessage())));
44+
.orElse(singletonList(error));
4645
}
4746

4847
private Optional<Throwable> extractException(GraphQLError error) {

0 commit comments

Comments
 (0)