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
Post a Comment