I want to catch an error in springMVC3 using an exception handler. I annotated the exception. I can catch a throw and any exception. But when I tried with Error.It does not catch exception.Any idea why its so. below code throws exceptions
ExceptionHandler(InvalidDataException.class)
public ModelMap handleException(InvalidDataException ex) {
logger.debug("exception catched :" + ex);
return new ModelMap();
}
But do not catch below.
@ExceptionHandler(Error.class)
public ModelMap handleException(Error ex) {
logger.debug("exception catched :" + ex);
return new ModelMap();
}
Irene source
share