-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat : CustomExceptionHandlerFilter를 통한 예외처리 #38
Conversation
private String toJson(ErrorResponse response) throws JsonProcessingException { | ||
ObjectMapper mapper = new ObjectMapper(); | ||
return mapper.writeValueAsString(response); | ||
} |
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.
저는 통합테스트 할 때 싱글톤 관련하여 리뷰를 받아서 ObjectMapper를 매 생성마다 만들지 않고 하나 만들어 놓고 그것을 계속 사용하도록 하였는데 통일하면 좋지 않을까요??
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.
ObjectMapper 객체를 호출할 때마다 생성하는 것이 아닌, 메서드 블럭 외부에서 생성시켜놓으면 좋겠다로 이해했는데 맞을까요?.?
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.
넵 맞는거 같아서 수정하였습니다~!~! ㅎㅎ
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum ErrorCode { | ||
NOT_EXIST_MEMBER("존재하지 않는 회원입니다."), | ||
NOT_FOUND_REFRESH_TOKEN("알 수 없는 RefreshToken입니다."), | ||
TOKEN_EXPIRES("토큰이 만료되었습니다. 다시 로그인 해 주세요."), |
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.
ACCESS_TOKEN_EXPIRED가 더 적절한 네이밍 같아요!
그리고 Access Token이 일치하지 않을 때도 TOKEN_EXPIRES
로 나가는지 궁금합니다!
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.
흐름을 잠시 설명해드리자면
- access token가 유효하지 않다면, refresh token을 확인하고
- refresh token도 유효하지 않다면, TOKEN_EXPIRES 메시지와 함께 출력합니다!
해당 ErrorCode는 전체 토큰이 유효하지 않을 때 사용되기에, access 키워드를 뺐습니다..!
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum ErrorCode { | ||
NOT_EXIST_MEMBER("존재하지 않는 회원입니다."), | ||
NOT_FOUND_REFRESH_TOKEN("알 수 없는 RefreshToken입니다."), |
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 #36
⛏ 작업 상세 내용
📝 작업 요약
☑️ 중점적으로 리뷰 할 부분