Im am using Spring AOP to log exceptions in my class. It is supposed to log all exceptions thrown in every method of the class.
@AfterThrowing(pointcut = "execution(* *.*(..))", throwing = "e")
protected void method(JoinPoint joinPoint,Exception e) throws Throwable {
However, if the method has a try catch block which catches the exception, advice is not triggered. If i remove the try catch block and add throws clause in method definition then advice is called. Is this how AOP is supposed to work coz it makes no sense? I just want a generic exception handling code for all exceptions at one place instead of in every method.