Closed
Description
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.