Skip to content

Commit 79c6ae2

Browse files
authored
Merge pull request #97 from osi/patch-1
log ExceptionWhileDataFetching stack trace
2 parents bc6f28c + 5bb8944 commit 79c6ae2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/graphql/servlet/DefaultGraphQLErrorHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public List<GraphQLError> processErrors(List<GraphQLError> errors) {
2828
.forEach(error -> {
2929
if(error instanceof Throwable) {
3030
log.error("Error executing query!", (Throwable) error);
31+
} else if (error instanceof ExceptionWhileDataFetching) {
32+
log.error("Error executing query {}", error.getMessage(), ((ExceptionWhileDataFetching) error).getException());
3133
} else {
3234
log.error("Error executing query ({}): {}", error.getClass().getSimpleName(), error.getMessage());
3335
}

0 commit comments

Comments
 (0)