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

✨ Seperate DomainException by response status #70

Merged
merged 5 commits into from
Jul 24, 2024
Merged

Conversation

HaiSeong
Copy link

  • 커스텀 예외에 status를 추가했습니다.
  • 각 요청의 예외마다 다른 status를 응답하기위해 handleDomainException 메서드에서 ResponseEntity를 리턴했습니다.
  • 일관성을 위해 handleException 메서드도 ResponseEntity를 리턴하게 했습니다.

@HaiSeong HaiSeong added ✨ feature new feature BE Backend labels Jul 23, 2024
@HaiSeong HaiSeong requested a review from geoje July 23, 2024 13:03
@HaiSeong HaiSeong self-assigned this Jul 23, 2024
Copy link

Overall Project 85.3% -3.09% 🍏
Files changed 60.98% 🍏

File Coverage
DomainException.java 100% 🍏
AuthenticationException.java 100% 🍏
TokenExtractor.java 100% 🍏
JwtTokenManager.java 100% 🍏
LoginService.java 93.7% -5.51% 🍏
GlobalExceptionHandler.java 61.22% -10.2% 🍏
IngredientException.java 0% -83.33% 🍏
UserException.java 0% -83.33% 🍏
CategoryException.java 0% -83.33% 🍏
RecipeException.java 0% -83.33% 🍏

Copy link
Contributor

@geoje geoje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전체적으로 커스텀 예외에 대하여 적용을 굉장히 잘 해주셨어요!

커스텀 예외 의견을 적극 어필해놓고 이제와서 이런 얘기하기 좀 그렇지만 DomainException 필드가 비슷해서 각 도메인에서 상태 코드를 결정해 주는 상황이면 그냥 Spring 5.0 에서 도입된 좋은 기본 예외 클래스 ResponseStatusException 는 어떨까 생각이 드네요...

둘 사용 사이에서 같이 고민해 보면 좋을 것 같아요! 아직 초기니깐요~

  • 클라이언트 응답에 불 필요한 값이 넘어가지 않는지?
  • 서버에 호출 시점이 로깅 되는지?

Copy link

Overall Project 85.33% -3.01% 🍏
Files changed 64.37% 🍏

File Coverage
DomainException.java 100% 🍏
AuthorizationHeaderException.java 100% 🍏
DuplicationException.java 100% 🍏
AuthenticationException.java 100% 🍏
JwtTokenException.java 100% 🍏
TokenExtractor.java 100% 🍏
JwtTokenManager.java 100% 🍏
LoginService.java 95.12% -4.07% 🍏
GlobalExceptionHandler.java 57.78% -11.11% 🍏
IngredientException.java 0% -80% 🍏
UserException.java 0% -80% 🍏
FirebaseTokenException.java 0% 🍏
CategoryException.java 0% -80% 🍏
RecipeException.java 0% -80% 🍏

@HaiSeong HaiSeong merged commit 2fc270a into be/dev Jul 24, 2024
1 check passed
@HaiSeong HaiSeong deleted the be/feat/65 branch July 24, 2024 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE Backend ✨ feature new feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants