Some code like this:
Both exceptions in A.a() and B.b() need to be intercept, so i use @AfterThrowing annotation do it. but the question is, when i call A.a() in other code and exception has occurred in B.b(), the Advice will execute twice! because exception that occurred in B.b() was propagating to its caller A.a().Code:public class A { @Autoware private B b; public void a() { //AAA: some logic process that maybe throw exception b.b(); } } public class B { public void b() { //BBB: some logic process maybe also throw exception } }
I can't swallow the exception silently, because i use spring-amqp, above codes is on Consumer side, i need some message processing that based on the exceptions that occurred in Consumer.
So, How can i intercept a exception just when it occurred? ignore propagation of it.
Any reply is greatly appreciated.
![]()


Reply With Quote