MCPcopy Create free account
hub / github.com/castello/spring_basic / catcher2

Method catcher2

ch2/ExceptionController.java:14–18  ·  view source on GitHub ↗
(Exception ex, Model m)

Source from the content-addressed store, hash-verified

12@Controller
13public class ExceptionController {
14 @ExceptionHandler({NullPointerException.class, FileNotFoundException.class})
15 public String catcher2(Exception ex, Model m) {
16 m.addAttribute("ex", ex);
17 return "error";
18 }
19
20 @ExceptionHandler(Exception.class)
21 @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) // 200 -> 500

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected