Spring Boot - Exception Handling
Consider this controller code snippet:
What will happen when the
@RestController
public class DemoController {
@GetMapping("/demo")
public String demo() {
throw new IllegalArgumentException("Invalid argument");
}
@ExceptionHandler(NullPointerException.class)
public String handleNull() {
return "Null error";
}
}What will happen when the
/demo endpoint is called?