我有一个带@Aspect注释的类正在调用ProceedingJoinPoint#proceed(). 这个方法throws Throwable和类看起来像这样:
@Aspect
@Component
public class MyClass{
@Around("@annotation(myAnnotation)")
public Object myMethod(final ProceedingJoinPoint joinPoint) throws Throwable {
//some code here
try {
return joinPoint.proceed();
} finally {
//some more code here
}
}
}
在我必须调用另一个方法的情况下myMehtod抛出一个是否可以?我应该避免投掷并以某种方式将其转换为or吗?Throwablethrows ThrowableThrowableExceptionError
无论哪种情况,我也想知道为什么。谢谢你。