-
Notifications
You must be signed in to change notification settings - Fork 3
[fix] GlobalExceptionHandler 참조 변경 및 파일 중복 해소 #140
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
[fix] GlobalExceptionHandler 참조 변경 및 파일 중복 해소 #140
Conversation
Walkthrough
Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related issues
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/java/umc/snack/common/exception/GlobalExceptionHandler.java(4 hunks)
🔇 Additional comments (2)
src/main/java/umc/snack/common/exception/GlobalExceptionHandler.java (2)
14-54: 예외 처리 로직의 일관성이 잘 유지되었습니다.모든 예외 핸들러 메서드에서 다음과 같이 변경사항이 일관되게 적용되었습니다:
- HTTP 상태 코드 처리 로직 유지
- 에러 메시지 처리 방식 동일
- 응답 구조 변경 없음
- 메서드 호출만
onFailure로 업데이트이러한 리팩토링은 기존 기능을 유지하면서 API 일관성을 개선합니다.
19-19: ✅ ApiResponse 메서드 변경 검증 완료
- ApiResponse.java(src/main/java/umc/snack/common/dto/ApiResponse.java)에서 onFailure 메서드 정의 확인
- fail 메서드 정의 및 호출이 코드베이스에 더 이상 존재하지 않음 확인
- 모든 ApiResponse.onFailure 호출이 일관되게 적용된 것 확인
기존 로직에 영향 없이 메서드명이 안전하게 변경되었으므로 추가 작업은 필요하지 않습니다.
| import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
| import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; | ||
| import umc.snack.common.response.ApiResponse; | ||
| import umc.snack.common.dto.ApiResponse; |
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.
💡 Verification agent
🧩 Analysis chain
import 경로 변경을 전체 코드베이스에서 검증하세요.
ApiResponse 클래스의 import 경로가 umc.snack.common.response.ApiResponse에서 umc.snack.common.dto.ApiResponse로 변경되었습니다. 이는 파일 중복 해소와 관련된 패키지 재구성으로 보입니다.
다음 스크립트를 실행하여 변경사항이 일관되게 적용되었는지 확인하세요:
🏁 Script executed:
#!/bin/bash
# 설명: ApiResponse import 경로 변경이 일관되게 적용되었는지 확인
# 이전 import 경로가 여전히 사용되고 있는지 확인
echo "=== 이전 import 경로 사용 확인 ==="
rg "umc\.snack\.common\.response\.ApiResponse" --type java
# 새로운 import 경로 사용 확인
echo -e "\n=== 새로운 import 경로 사용 확인 ==="
rg "umc\.snack\.common\.dto\.ApiResponse" --type java
# ApiResponse 클래스 파일 위치 확인
echo -e "\n=== ApiResponse 클래스 파일 위치 확인 ==="
fd "ApiResponse.java"Length of output: 2204
ApiResponse import 경로 불일치 발견 및 수정 필요
다음 파일에서 아직 이전 패키지 경로를 사용하고 있어 일관성이 깨집니다.
모든 곳에서 umc.snack.common.dto.ApiResponse로 통일해주세요.
-
수정 대상
src/main/java/umc/snack/controller/article/ArticleController.java(라인 9)
-
변경 예시
- import umc.snack.common.response.ApiResponse; + import umc.snack.common.dto.ApiResponse;
추가로, 이제 더 이상 사용되지 않는 src/main/java/umc/snack/common/response/ApiResponse.java 파일은 삭제하거나 dto 패키지의 구현으로 통합하는 방안을 검토해주세요.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In src/main/java/umc/snack/controller/article/ArticleController.java at line 9,
update the import statement for ApiResponse to use the correct package path
umc.snack.common.dto.ApiResponse instead of the old one. Also, consider removing
or refactoring the unused
src/main/java/umc/snack/common/response/ApiResponse.java file to avoid confusion
and maintain consistency.
작업 내용
변경 사항
테스트 방법
관련 이슈
특이사항
머지 전 필수 체크리스트
[기능] ~)Summary by CodeRabbit