Browse Source

切面不捕获异常

dev_shibei_match
jianjun 4 years ago
parent
commit
b5874ae175
  1. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java

@ -35,9 +35,8 @@ public class NoRepeatSubmitAop {
private DistributedLock distributedLock;
@Around("@annotation(noRepeatSubmit)")
public Object around(ProceedingJoinPoint pjp, NoRepeatSubmit noRepeatSubmit) {
public Object around(ProceedingJoinPoint pjp, NoRepeatSubmit noRepeatSubmit) throws Throwable {
try {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
assert attributes != null;
HttpServletRequest request = attributes.getRequest();
@ -64,12 +63,7 @@ public class NoRepeatSubmitAop {
return result;
} catch (RenException e) {
throw e;
} catch (Throwable e) {
log.error("验证重复提交时出现未知异常!");
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
}
}
private String getKey(String keyExpress, String token) {

Loading…
Cancel
Save