| 7 | import 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected