独自の例外「MyOwnException」があり、サービス クラスからこの例外をスローします
public void service() throws MyOwnException
{
// some code
}
ここで、アドバイスで MyOwnException をキャッチし、新しい例外を再スローしたいと考えています。
public class SimpleThrowsAdvice implements ThrowsAdvice {
public void afterThrowing(Method method, Object[] args, Object target,
MyOwnException ex) throws Throwable {
throw new Exception("new Description",ex);
}
}
Exception
さて、上記の Advice から再スローされたものをどのようにキャッチできSimpleThrowsAdvice
ますか?