-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CHORE] 커스텀 에러 및 핸들러 구현 #35
Conversation
Test Results24 tests 24 ✅ 3s ⏱️ Results for commit 2a5a268. ♻️ This comment has been updated with latest results. |
📝 Test Coverage Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/noti @coli-geonwoo
굳! 코멘트 답변 부탁드립니다!
public ResponseEntity<ErrorResponse> handleBindingException(BindException exception) { | ||
log.warn("message: {}", exception.getMessage()); | ||
return toResponse(ClientErrorCode.FIELD_ERROR); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[질문] 전부 ResponseEntity를 사용하신 이유가 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
다른 PR에서도 말했지만
- controller위 추상화 준위에 reponseentity가 올바르다고 생각하는 점
- 확장에 용이하다는 점
- 정적 메서드 제공으로 휴먼에러 방지에 용이하고 가독성이 좋다는 점
을 이유로 선호해요. 목요일 회의 이후에 명확히 컨벤션 정하고 반영하겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/noti
사소한 개행 리뷰 하나 남겨서 바로 approve합니다~
public enum ServerErrorCode implements ErrorCode { | ||
INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "서버 오류가 발생했습니다. 관리자에게 문의하세요."), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
개행이 필요할 것 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영하겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어프루브 누를께용
🚩 연관 이슈
closed #28
🌟 Description
ErrorCode
ErrorCode : status와 메시지를 정의합니다. (땅콩 소스코드 참고했습니다 🥜 )
DTException : 최상위 abstract 클래스(status와 message를 필드로 가짐)
✨ 에러 핸들링 전략
🗣️ 리뷰 요구사항 (선택)
현재는 DTException의 존재 이유가 크게 느껴지지 않아서, abstract 클래스를 없애고 DTClientException은 필드로 ClientErrorCode를 DTServerException은 필드로 ServerErrorCode를 들고 있게 하는 건 어떨까요?
타입계층의 존재이유가 크게 없는 것 같아 여쭈어요.