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

GraphQLErrorHandlerFactory does not find ExceptionHandlers #166

@juriad

Description

@juriad
  1. 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

  2. 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 {

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions