Skip to content

Support for @ExceptionHandler inside @RestController only works if a @RestControllerAdvice class is present #1498

Closed
@SimonAlthoff

Description

@SimonAlthoff

Describe the bug
The @ExceptionHandler methods inside a @RestController are picked up correctly if and only if there is at least one class present which is annotated with @RestControllerAdvice. This class might be empty, though.

To Reproduce
I created a fork of the master branch and added a new test app182 which is a copy of the test app124.
Except that both @exceptionhandlers are contained in the @RestController and the @RestControllerAdvice class was removed.

SimonAlthoff@8db9112

Expected behavior
@ExceptionHandler within a @RestController are picked up even when no @RestControllerAdvice class exists.

Additional context
The original feature was implemented in ticket #748

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions