Spring Boot - Exception Handling
What will be the response body when a
NullPointerException is thrown and handled by this @ControllerAdvice?
@ControllerAdvice
public class GlobalHandler {
@ExceptionHandler(NullPointerException.class)
public ResponseEntity handleNull(NullPointerException ex) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Null value error");
}
} 