Skip to content
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

[REFACTOR]/#86 - Exception 구조 변경 #98

Merged
merged 1 commit into from
Apr 8, 2024
Merged

[REFACTOR]/#86 - Exception 구조 변경 #98

merged 1 commit into from
Apr 8, 2024

Conversation

koojun99
Copy link
Contributor

@koojun99 koojun99 commented Apr 8, 2024

🚀 개요

기존의 GeneralExceptionGlobalErrorCode 로만 관리하던 예외처리 방식에서 도메인 별 예외처리로 변경하여 관리하도록 변경

🔍 변경사항

  • 에러 코드 구조를 httpStatus + 'code+message` 구조로 변경
  • code 부분을 "PREFIX + code" 구조로 변경하여 API 연결 테스트 시, 더 직관적으로 오류의 원인을 찾을 수 있도록 변경
  • 로그인/회원가입 서비스 로직에서 예외 발생 시, AuthException 을 던지도록 변경

⏳ 작업 내용

  • BaseErrorCode를 이용하여 도메인 별 에러코드로 구조화
  • 에러 코드의 구조를 httpStatus + 'code+message` 구조로 변경
  • 에러코드의 code 부분을 "PREFIX + code" 구조로 변경하여 API 연결 테스트 시, 더 직관적으로 오류의 원인을 찾을 수 있도록 변경
  • JWT 토큰 관련에서 발생하는 예외와 로그인/회원가입 서비스 로직에서 발생하는 예외에 대해 AuthException 을 던지도록 변경

📝 논의사항

예외처리 리팩토링 과정에서 JWT 관련 Exception에 대한 처리 부분도 건드렸는데 추후에 문제가 없을 지 궁금합니다!

@koojun99 koojun99 added the ♻️ refactor Refactoring code label Apr 8, 2024
@koojun99 koojun99 requested a review from CYY1007 April 8, 2024 13:51
@koojun99 koojun99 self-assigned this Apr 8, 2024
@koojun99 koojun99 linked an issue Apr 8, 2024 that may be closed by this pull request
1 task
@CYY1007 CYY1007 merged commit 9221109 into develop Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ refactor Refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🔨[refactor] Exception 구조 변경
2 participants