-
Notifications
You must be signed in to change notification settings - Fork 0
Be/refactor/#569 api 커스텀 에러 정의 #570
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
Merged
Merged
The head ref may contain hidden characters: "BE/refactor/#569-API-\uCEE4\uC2A4\uD140-\uC5D0\uB7EC-\uC815\uC758"
Conversation
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
- HttpException 상속 - ExceptionMetadata를 바탕으로 HttpException 작성
👍 오 좋다!! 이제 프론트에서도 에러 처리하기 더 좋아졌어👍 👍 |
Doosies
approved these changes
Feb 23, 2024
모듈의 앞 글자가 같은 경우도 있을 것 같아서 이렇게 어때?
|
HeoJiye
approved these changes
Feb 23, 2024
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.
👍👍
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.
🔮 resolved #569
변경 사항
고민과 해결 과정
1️⃣ 예외 메타데이터
kakao developers를 참고하여 커스텀 에러를 작성했다. 커스텀 에러는 다음 구조를 갖는다.
사용자에게는
message
만 표기하여 민감한 정보를 노출하지 않고, 개발자는 고유한 에러 코드를 통해 원인을 빠르게 파악할 수 있다. 아래는 에러코드의 예시다. 사용자에게는로그인 실패
에 대한 메시지만 전달하여 구체적인 에러에 대한 정보를 노출하지 않는다.2️⃣ 고유 에러코드
고유 에러코드의 명명 규칙인 다음과 같다. 카카오의 경우,
KOE001
형태의 에러코드를 사용하고 있는데 이와 유사하게 작성했다.M
: 마법의 소라고둥의 앞 글자(모듈)
: 모듈의 첫 글자 (현재 프로젝트 기준, 모듈명이 겹치지 않아 사용 가능)E
: 에러(선택) 테스트 결과