I am using Spring Boot 2.3.1, I try to make a custom ExceptionHandler,
Here is my CustomHandler class:
@ControllerAdvice()
public class AppExceptionHandler extends ResponseEntityExceptionHandler{
@ExceptionHandler(value = {Exception.class, RuntimeException.class, NullPointerException.class})
public ResponseEntity<Object> handleAnyException(Exception ex, WebRequest request){
System.out.println("===>App Exception was callled....!");
return new ResponseEntity<>(
ex, new HttpHeaders(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
And my project structure:
I can't get any response from this class, it seems like it was not loaded.
Thanks.
