I have my own exeception "MyOwnExeception" and throw this exeception from my service class
public void service() throws MyOwnExeception
{
// some code
}
Now I want to catch MyOwnExeception in an advice and rethrow a brand-new Exeception
public class SimpleThrowsAdvice implements ThrowsAdvice {
public void afterThrowing(Method method, Object[] args, Object target,
MyOwnExeception ex) throws Throwable {
throw new Exception("new Description",ex);
}
}
Now,I want to catch the re-thrown "Exception" from the above Advice "SimpleThrowsAdvice ",
How I can catch exeception "Exeception"?.