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

Class GlobalCatcher

ch2/GlobalCatcher.java:9–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7import org.springframework.web.bind.annotation.ExceptionHandler;
8
9 @ControllerAdvice("com.fastcampus.ch3") // ÁöÁ¤µÈ ÆÐŰÁö¿¡¼­ ¹ß»ýÇÑ ¿¹¿Ü¸¸ ó¸®
10// @ControllerAdvice // ¸ðµç ÆÐŰÁö¿¡ Àû¿ë
11 public class GlobalCatcher {
12 @ExceptionHandler({NullPointerException.class, FileNotFoundException.class})
13 public String catcher2(Exception ex, Model m) {
14 m.addAttribute("ex", ex);
15 return "error";
16 }
17
18 @ExceptionHandler(Exception.class)
19 public String catcher(Exception ex, Model m) {
20 m.addAttribute("ex", ex);
21
22 return "error";
23 }
24 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected