Skip to content

ErrorController no longer called for response.sendError #29105

Closed
@robtimus

Description

@robtimus

In Spring Boot 2.5.7 and before, a not found error, AuthenticationException or AccessDeniedException (basically anything that uses response.sendError) goes through the ErrorController - either BasicErrorController or a custom bean implementing ErrorController. In Spring Boot 2.6.0 and 2.6.1, this no longer occurs. That makes any custom ErrorController bean useless for a lot of cases, and requires other ways of getting the same functionality.

This is very easy to reproduce using non-custom code (apart from maybe a small main method). Put a breakpoint in class BasicErrorController, method error(HttpServletRequest request), and call any non-existing endpoint. In Spring Boot 2.5.7 the breakpoint is triggered, in 2.6.0 and 2.6.1 it is not.

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