我有自己的异常“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
中抓住重新抛出的SimpleThrowsAdvice
?