Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 946
  • Last Modified:

How to ignore exceptions thrown by Advice class

Say I have an AOP advice method that throws an exception.

I have after-throwing interceptors (multiple) in place to log the exception but after that I wish to catch the exception and ignore it, but only if it eminates from the advice code, and not the original proxied class.

Is there a way to do this so that the exception from the aop advice does not interfere with the operation of the main application, or do I need to set up every advice method with an @Around and handle it within there?

Can I set up a pointcut on Advice methods so that I can trap exceptions only if they occur within the advice methods?
0
sweetfa2
Asked:
sweetfa2
  • 2
1 Solution
 
ThlwareCommented:
try{
.....your operations
}catch(AdviceException e){ //do nothing in here }
0
 
sweetfa2Author Commented:
Thanks, I was looking for a way to do it that is generic without wrapping each of my operations.  I have created a wrapper class at the moment that does all that but it means that I can't use the <aop: options to configure anything as the afterReturning etc methods need to be wrapped with the error handling wrapper.
0
 
sweetfa2Author Commented:
Wasn't really what I wanted but simplistically is a workable solution, and you did bother to respond, so you get the points.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now