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

feat: ErrorResponse 클래스 분리 및 Swagger Error Example 공통 처리 추가 #52

Merged
merged 3 commits into from
Mar 3, 2025

Conversation

kkjsw17
Copy link
Collaborator

@kkjsw17 kkjsw17 commented Mar 2, 2025

변경 유형

  • 버그 수정
  • 새로운 기능
  • 리팩토링
  • 문서 업데이트

변경 사항

  • ErrorResponse 클래스를 분리합니다.
    • 에러 판별 기준을 success 필드가 아닌 status code로 변경하기 위해서입니다.
    • 기존 ApiResponse는 성공한 경우, ErrorResponse는 실패한 경우만 커버합니다.
  • ApiErrorCodes 어노테이션을 추가합니다.
    • Controller Method에 달아두면, ErrorCode에 맞는 에러 Response Example을 제공합니다.
      • status로 그룹화한 뒤, errorCode 목록에서 선택 가능한 형태입니다.
        스크린샷 2025-03-03 오전 4 45 45
    • 해당 링크 참조하면서 했는데, 코드 구성은 많이 다릅니다.
  • ErrorCodeinterface -> enum class로 변경하고, 각 도메인 ErrorCode를 통합합니다.
    • 보일러 플레이트 많이 생기고, 공통 처리하기 까다로워서 바꿉니다.

관련링크 (JIRA, Github, etc)

@kkjsw17 kkjsw17 self-assigned this Mar 2, 2025
@kkjsw17 kkjsw17 changed the title Feature/separate error response feat: ErrorResponse 클래스 분리 및 Swagger Error Example 공통 처리 추가 Mar 2, 2025
@kkjsw17 kkjsw17 merged commit 063d588 into depromeet:develop Mar 3, 2025
@kkjsw17 kkjsw17 deleted the feature/separate_error_response branch March 3, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ErrorCode 기반 스웨거 ErrorResponse Example 자동화 어노테이션 추가 ErrorResponse 분리
2 participants