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

Commit 204a82f

Browse files
authored
Merge pull request #614 from graphql-java-kickstart/bugfix/611-disable-exception-handler
fix(#611): allow exception handlers to be disabled
2 parents 4c540a2 + 2cf9fba commit 204a82f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public GraphQLErrorHandler create(
2727
.flatMap(List::stream)
2828
.collect(toList());
2929

30-
if (!factories.isEmpty() || exceptionHandlersEnabled) {
30+
if (exceptionHandlersEnabled) {
3131
log.debug(
3232
"Handle GraphQL errors using exception handlers defined in {} custom factories",
3333
factories.size());
@@ -43,7 +43,7 @@ private List<GraphQLErrorFactory> scanForExceptionHandlers(
4343
try {
4444
Class<?> objClz = context.getType(name);
4545
if (objClz == null) {
46-
log.info("Cannot load class " + name);
46+
log.info("Cannot load class {}", name);
4747
return emptyList();
4848
}
4949
return Arrays.stream(objClz.getDeclaredMethods())

graphql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/spring/web/boot/GraphQLErrorHandlerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public GraphQLErrorHandlerTest() {
2929
@BeforeEach
3030
public void setUp() {
3131
System.setProperty("graphql.tools.schemaLocationPattern", "graphql/error-handler-test.graphql");
32+
System.setProperty("graphql.servlet.exception-handlers-enabled", "true");
3233
load(BaseConfiguration.class);
3334

3435
GraphQLSchema schema = getContext().getBean(GraphQLSchema.class);

0 commit comments

Comments
 (0)