Repository navigation
refactor: 도메인 예외의 중복 보일러플레이트를 공통 클래스로 모은다 - #146
Merged
Merged
Conversation
- 11개 *ExceptionType enum이 같은 withDetail 구현과 Detailed* record를 각자 복사해 갖고 있었다. BcsdExceptionType의 default 메서드와 공용 DetailedExceptionType 하나로 합친다. - 12개 도메인 예외가 똑같이 갖고 있던 exceptionType 필드·getter를 BcsdException으로 올리고, 도메인 예외는 생성자만 남긴다. 호출부(new GameException(...))와 응답은 그대로다. - 메시지를 직접 만드는 ImportFileInvalidType·SlackIdDuplicatedType은 기존 withDetail 동작을 유지한다.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
요약
동작을 바꾸지 않는 리팩토링. 356줄 삭제, 23줄 추가.
*ExceptionTypeenum 11개: 각자 같은withDetail구현과Detailed{Domain}ExceptionTyperecord(약 24줄)를 복사해 갖고 있었다.BcsdExceptionType.withDetail을 default 메서드로 바꾸고 공용DetailedExceptionType하나로 합쳤다.GameException등): 같은exceptionType필드·생성자·getter를 각자 갖고 있었다. 이를BcsdException으로 올리고 각 클래스는 생성자 한 줄만 남겼다. 도메인 예외 클래스 자체는 유지해서 호출부(new GameException(GameExceptionType.X))는 바뀌지 않는다.ImportFileInvalidType,SlackIdDuplicatedType)은 자체withDetail오버라이드를 그대로 둬 기존 동작을 유지한다.동작 동일성
withDetail메시지 형식(MESSAGE_FORMAT)이 그대로다. 상세가 붙은 타입에 다시withDetail하면 원래 타입에 새 상세를 붙이는(이전 상세를 대체하는) 동작도 같다 — 계약 테스트에 1건 추가.테스트
./gradlew test: 541건 중 540 통과, 1 스킵.