在我的WebFlux应用程序(带注释的控制器)中,我注意到如果从@RestController方法抛出异常,则执行@ControllerAdvice中的@ExceptionHandler并正确处理异常。但是,如果异常较早发生,例如在WebFilter中,则不执行处理程序。我阅读了WebFlux文档,发现了以下内容:
However, keep in mind that, in WebFlux, you cannot
处理程序很简单:public class AccessDeniedExceptionHandler extends ResponseEntityExceptionHandler:118) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.security.web.FilterChainProxy:137) ~[spring-security</em