File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
src/main/java/graphql/servlet Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -26,20 +26,22 @@ public List<GraphQLError> processErrors(List<GraphQLError> errors) {
2626
2727 errors .stream ()
2828 .filter (error -> !isClientError (error ))
29- .forEach (error -> {
30- if (error instanceof Throwable ) {
31- log .error ("Error executing query!" , (Throwable ) error );
32- } else if (error instanceof ExceptionWhileDataFetching ) {
33- log .error ("Error executing query {}" , error .getMessage (), ((ExceptionWhileDataFetching ) error ).getException ());
34- } else {
35- log .error ("Error executing query ({}): {}" , error .getClass ().getSimpleName (), error .getMessage ());
36- }
37- });
29+ .forEach (this ::logError );
3830 }
3931
4032 return clientErrors ;
4133 }
4234
35+ protected void logError (GraphQLError error ) {
36+ if (error instanceof Throwable ) {
37+ log .error ("Error executing query!" , (Throwable ) error );
38+ } else if (error instanceof ExceptionWhileDataFetching ) {
39+ log .error ("Error executing query {}" , error .getMessage (), ((ExceptionWhileDataFetching ) error ).getException ());
40+ } else {
41+ log .error ("Error executing query ({}): {}" , error .getClass ().getSimpleName (), error .getMessage ());
42+ }
43+ }
44+
4345 protected List <GraphQLError > filterGraphQLErrors (List <GraphQLError > errors ) {
4446 return errors .stream ()
4547 .filter (this ::isClientError )
You can’t perform that action at this time.
0 commit comments