java - Make @ExceptionHandler handle every exception except AccessDeniedException? -


i wrote @exceptionhandler send exception in json rest requests. however, due way spring security works, accessdeniedexceptions must not handled.

if rethrow accessdeniedexception in handler, error level logging saying:

failed invoke @exceptionhandler method: somemethod() throws java.lang.exception org.springframework.security.access.accessdeniedexception: access denied ...stack... 

i cannot safely disable error level logging class logging (exceptionhandlerexceptionresolver), having these stacktrace quite confusing operations people.

is there anyway make @exceptionhandler not handle specific exception?

issue raised: https://jira.spring.io/browse/spr-13932

may fixed in spring 5.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -