I've got an @Aspect
annotated class that is calling ProceedingJoinPoint#proceed()
.
This method throws Throwable
and thus the class looks something like this:
@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
}
}
}
Is it ok for myMehtod
to throw a Throwable
in this scenario where I have to call another method that throws Throwable
?
Should I avoid throwing Throwable
and somehow convert it to Exception
or Error
?
In either case I'd like to know why as well. Thank you.