में AsTT में AfterThrowing पर अपवाद कैसे निगलें, मैं एक अपवाद निगलना चाहता हूं।AspectJ
@Aspect
public class TestAspect {
@Pointcut("execution(public * *Throwable(..))")
void throwableMethod() {}
@AfterThrowing(pointcut = "throwableMethod()", throwing = "e")
public void swallowThrowable(Throwable e) throws Exception {
logger.debug(e.toString());
}
}
public class TestClass {
public void testThrowable() {
throw new Exception();
}
}
ऊपर, यह अपवाद निगल नहीं था। TestThrowable() के कॉलर अभी भी अपवाद प्राप्त किया। मैं कॉलर को अपवाद प्राप्त नहीं करना चाहता हूं। यह कैसे कर सकता है? धन्यवाद।
धन्यवाद Tadeusz! मैंने हल किया है! – user389227