Skip to content

[FIX] 에러 처리 수정#90

Merged
hhjo96 merged 1 commit into
devfrom
feature/bids
May 12, 2026
Merged

[FIX] 에러 처리 수정#90
hhjo96 merged 1 commit into
devfrom
feature/bids

Conversation

@hhjo96

@hhjo96 hhjo96 commented May 11, 2026

Copy link
Copy Markdown
Contributor

📝 작업 내용

  • 에러 처리를 ServiceErrorException으로 하지 않아서 수정했습니다.

🔗 관련 이슈 (Related Issues)

Closes #

✅ 체크리스트 (Checklist)

  • 브랜치 이름 규칙을 준수했나요? (예: feat/login)
  • 코딩 컨벤션을 준수했나요?
  • 기능에 대한 테스트 코드를 작성/수행했나요?
  • 불필요한 주석이나 로그(console.log)를 제거했나요?

💬 기타 사항

Summary by CodeRabbit

  • 버그 수정
    • 아웃박스 레코드 재시도 기능에서 존재하지 않는 레코드를 조회할 때 일관된 오류 응답을 제공하도록 개선되었습니다.

Review Change Stack

@hhjo96 hhjo96 added the Refactor 코드 개선 label May 11, 2026
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

워크스루

OutboxErrorEnum 에러 열거형을 도입하고 OutboxAdminService의 재시도 로직이 표준화된 에러 처리를 사용하도록 업데이트했습니다. 일반 예외 대신 타입 안전 에러 열거형을 사용합니다.

변경사항

Outbox 에러 처리 표준화

계층 / 파일(s) 요약
에러 열거형 정의
src/main/java/com/example/auction/domain/auction/eventBridge/exception/OutboxErrorEnum.java
ErrorEnumInterface를 구현하는 OutboxErrorEnum 열거형이 추가되었고, OUTBOX_NOT_FOUND 상수는 HttpStatus.NOT_FOUND와 "해당하는 이벤트를 찾을 수 없습니다" 메시지를 가집니다.
서비스 에러 처리 통합
src/main/java/com/example/auction/domain/auction/eventBridge/service/OutboxAdminService.java
retry() 메서드에서 outbox를 찾을 수 없을 때 ServiceErrorException(OutboxErrorEnum.OUTBOX_NOT_FOUND)를 던지도록 변경되었습니다.

평가된 코드 리뷰 노력

🎯 1 (간단함) | ⏱️ ~8 분

제안된 라벨

BugFix

제안된 검토자

  • imprity
  • soomin0209
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive PR 제목은 에러 처리 수정에 관한 변경사항을 대략적으로 설명하고 있으나, 구체적이지 않아 변경 사항의 핵심을 명확히 전달하지 못합니다. 제목을 더 구체적으로 수정하여 OutboxErrorEnum 추가 및 ServiceErrorException 적용 등의 구체적인 변경 사항을 언급하는 것을 권장합니다.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed PR 설명은 기본 템플릿 구조를 따르고 있으나, 작업 내용이 매우 간단하며 관련 이슈 번호가 기입되지 않았고, 테스트 코드 작성이 미완료된 상태입니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/bids

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/main/java/com/example/auction/domain/auction/eventBridge/service/OutboxAdminService.java (1)

27-31: ⚡ Quick win

retry 실패 케이스 테스트를 추가해 주세요.

현재 변경의 핵심 동작(없는 ID일 때 ServiceErrorException + OUTBOX_NOT_FOUND)을 서비스 테스트로 고정해 두면 회귀를 막는 데 효과적입니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/example/auction/domain/auction/eventBridge/service/OutboxAdminService.java`
around lines 27 - 31, Add a unit test for OutboxAdminService.retry that verifies
the failure path: when outboxRepository.findById returns empty the method throws
ServiceErrorException with OutboxErrorEnum.OUTBOX_NOT_FOUND; mock
outboxRepository to return Optional.empty() for a nonexistent id, call
retry(outboxId) and assert the thrown exception type and enum value, and ensure
you reference the retry method on OutboxAdminService and the expected
ServiceErrorException/OutboxErrorEnum constants in the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@src/main/java/com/example/auction/domain/auction/eventBridge/service/OutboxAdminService.java`:
- Around line 27-31: Add a unit test for OutboxAdminService.retry that verifies
the failure path: when outboxRepository.findById returns empty the method throws
ServiceErrorException with OutboxErrorEnum.OUTBOX_NOT_FOUND; mock
outboxRepository to return Optional.empty() for a nonexistent id, call
retry(outboxId) and assert the thrown exception type and enum value, and ensure
you reference the retry method on OutboxAdminService and the expected
ServiceErrorException/OutboxErrorEnum constants in the test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 43558633-dfa0-4690-950b-e15018e05529

📥 Commits

Reviewing files that changed from the base of the PR and between 93c8b91 and 8c146d9.

📒 Files selected for processing (2)
  • src/main/java/com/example/auction/domain/auction/eventBridge/exception/OutboxErrorEnum.java
  • src/main/java/com/example/auction/domain/auction/eventBridge/service/OutboxAdminService.java

@soomin0209 soomin0209 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@hhjo96 hhjo96 merged commit ff5acf9 into dev May 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor 코드 개선

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants