我有一个带有以下签名的方法
我想在我的切入点捕获后记录异常,现在当我执行代码时它会在控制台上抛出异常打印然后来到我的切入点定义的方法,可能是因为它是@AfterThoring 注释但没有@BeforeThrowing注释可用?请建议我能做什么
public void jingleBell(){
System.out.println("Jingle Bell Job...");
throw new RuntimeException("test error");
}
并遵循切入点的建议
@AfterThrowing(pointcut = "execution(* com.dc.lnwsk.adapter.Search.jingleBell())", throwing = "ex")
public void handleException(Throwable ex){
//Log exception
}