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

Commit 1306cc1

Browse files
committed
Improved error handling scanning mechanism fix #254
1 parent 75a4210 commit 1306cc1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/error/GraphQLErrorHandlerFactory.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ public GraphQLErrorHandler create(ConfigurableApplicationContext applicationCont
3838

3939
private List<GraphQLErrorFactory> scanForExceptionHandlers(ApplicationContext context, String name) {
4040
try {
41-
Class<?> objClz = context.getBean(name).getClass();
41+
Class<?> objClz = context.getType(name);
42+
if (objClz == null) {
43+
log.info("Cannot load class " + name);
44+
return Collections.emptyList();
45+
}
4246
return Arrays.stream(objClz.getDeclaredMethods())
4347
.filter(this::isGraphQLExceptionHandlerMethod)
4448
.map(method -> GraphQLErrorFactory.withReflection(context.getBean(name), method))

0 commit comments

Comments
 (0)