[Week8] 예외처리 2 - 양권모#137
Open
Praesentia-YKM wants to merge 9 commits into
Open
Conversation
…template-main 2주차 자바 웹 요청 추상화
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Week 8 — 인터셉터 & 예외 처리 hook
요청/응답 전후 공통 관심사와 예외 처리를 비즈니스 로직에서 분리하는 것이 목표였습니다.
인터셉터·예외 resolver hook을 추가하고, 예외 처리를
@ControllerAdvice로 선언적으로 작성하여 해소하였습니다.HandlerInterceptorpreHandle/postHandle/afterCompletion). default 메서드라 필요한 것만 구현HandlerExceptionResolvernull반환 = 다음 resolver에 양보@ControllerAdvice/@ExceptionHandler