feat(REQ-2516): 完善记录异常逻辑

This commit is contained in:
wangli 2024-06-25 13:59:11 +08:00
parent b05ba57a7d
commit 2f537e0001
2 changed files with 1 additions and 5 deletions

View File

@ -27,8 +27,4 @@ public interface ExceptionResultHandler<T extends Throwable, R extends Result> {
default boolean isRecursive() {
return false;
}
default boolean shouldFilter(ExceptionResultHandler<? extends Throwable, ? extends Result> handler, Throwable e) {
return handler.getExceptionClass().isAssignableFrom(e.getClass());
}
}

View File

@ -281,7 +281,7 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
private boolean shouldFilter(ExceptionResultHandler<? extends Throwable, ? extends Result> handler, Throwable e) {
if (handler.isRecursive()) {
return handler.shouldFilter(handler, e);
return handler.getExceptionClass().isAssignableFrom(e.getClass());
}
return handler.getExceptionClass() == e.getClass();
}