-
@ExecptionHandler 코드 조금 더 보고 공부하기공부/기본 2023. 11. 20. 08:18
- Controller 계층에서 에러를 잡아 메서드로 처리해주는 기능
ex)
@Controller public class SimpleController{ @ExceptionHandler public ResponseEntity<String> handle(IOException ex){ } }
- @Controller로 선언된 클래스 안에서 @ExceptionHandler 어노테이션으로 메서드 안에서 발생할 수 있는 에러를 처리할 수 있다
'공부 > 기본' 카테고리의 다른 글
예외 클래스의 계층구조 (1) 2023.11.20 Spring MVC 아키텍처 (0) 2023.11.20 JWT 토큰 (0) 2023.11.17 java 에러_(03) (0) 2023.11.17 Swagger (0) 2023.11.17