我有自己的异常“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
?