Lets say I'm using @ExceptionHandler in my application.
If I define :
@ControllerAdvice
public class MyExceptionHandler {
@ExceptionHandler(value = Exception.class)
public boolean generic(Exception e) {
return e;
}
@ExceptionHandler(value =MyException.class)
public boolean myException(MyException e) {
return e;
}
}
Il my controller throws a MyException, will the generic exception handler be triggered too or only the best match with for the exception will be executed (here the MyException handler) ?