我想使用@ExceptionHandler来处理任何Hibernate异常。如果异常不是Hibernate异常,则@ExceptionHandler for Runtime errors处理该异常。 问题是,运行时异常总是优先于Hibernate异常处理程序。这意味着,发生的任何hibernate异常都将由通用的</em
我编写了一个@ExceptionHandler,用JSON为REST请求发送异常。然而,由于Spring Security的工作方式,AccessDeniedException不能被处理。如果我只是在处理程序中重新抛出一个AccessDeniedException,我会得到一个ERROR级别的日志记录,上面写着:
Failed to invoke @ExceptionHandler method我不能安全地禁用类logging it