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

Description
-
a method annotated with ExceptionHandler is not found if the bean is a CGLib proxy (e.g. Configuration) or if the method is defined in an ancestor
-
a bean may not be found in context.getBean(className) as the bean can be registered in the application context with a name different from its fully qualified name - this leads to NoSuchBeanDefinitionException and application failure
I managed to overcome both issues with:
@Component("com.company.x360.ExceptionHandlers")
class ExceptionHandlers {
@ExceptionHandler(Throwable::class)
fun handleException(e: Throwable): GraphQLError {