Skip to content

[Week8] 예외처리 2 - 양권모#137

Open
Praesentia-YKM wants to merge 9 commits into
Loopers-play-dev-lab:Praesentia-YKMfrom
Praesentia-YKM:week8
Open

[Week8] 예외처리 2 - 양권모#137
Praesentia-YKM wants to merge 9 commits into
Loopers-play-dev-lab:Praesentia-YKMfrom
Praesentia-YKM:week8

Conversation

@Praesentia-YKM

Copy link
Copy Markdown
Collaborator

Week 8 — 인터셉터 & 예외 처리 hook

요청/응답 전후 공통 관심사와 예외 처리를 비즈니스 로직에서 분리하는 것이 목표였습니다.
인터셉터·예외 resolver hook을 추가하고, 예외 처리를 @ControllerAdvice로 선언적으로 작성하여 해소하였습니다.

기능 내용
HandlerInterceptor handler 전후 hook (preHandle/postHandle/afterCompletion). default 메서드라 필요한 것만 구현
HandlerExceptionResolver 컨트롤러가 던진 예외를 응답으로 변환하는 hook. null 반환 = 다음 resolver에 양보
@ControllerAdvice / @ExceptionHandler 예외 타입 ↔ 처리 메서드를 선언적으로 매핑. 반환 데이터는 framework가 JSON 직렬화

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants