Hi,
We have implemented a SPRING interceptor, which is invoked for exception raised in application. Is there any way to suppress that exception in interceptor itself, so that the process will continue as it is and it wont result in termination.
Hi,
We have implemented a SPRING interceptor, which is invoked for exception raised in application. Is there any way to suppress that exception in interceptor itself, so that the process will continue as it is and it wont result in termination.
Hi,
Thanks for replying, but in that case the service class will endup having those try/catch blocks. At the end of the day, the application will have two approaches one in which an app uses interceptor while in some scenario there is try/catch block. (which basically we dont want inside the code.)
What do you mean by "allow the process to continue"? If you are talking about the controller continuing, then that isn't possible unless you catch the exception and handle it appropriately in the method that throws the exception.
However, if you mean continuing by hitting the other methods in the interceptor then you probably want to modify the HandlerAdapter to catch the error.
If you are talking about handling the exception in a more elegant way, then you may want to look at a HandlerExceptionResolver.
In any case, something has to catch the error. Otherwise it will go all the way through to the container to handle.