获得未声明的可清除异常而不是我自己的例外
我有以下代码
public Object handlePermission(ProceedingJoinPoint joinPoint, RequirePermission permission) throws AccessException, Throwable {
System.out.println("Permission = " + permission.value());
if (user.hasPermission(permission.value())) {
System.out.println("Permission granted ");
return joinPoint.proceed();
} else {
System.out.println("No Permission");
throw new AccessException("Current user does not have required permission");
}
}
当我使用没有权限的用户时,我得到的不是 。java.lang.reflect.UndeclaredThrowableException
AccessException