Skip to content

[Debug] 500 에러 원인 파악을 위한 예외 핸들러 로깅 추가#191

Merged
unam98 merged 2 commits intodevfrom
feature/add-exception-logging
Apr 30, 2026
Merged

[Debug] 500 에러 원인 파악을 위한 예외 핸들러 로깅 추가#191
unam98 merged 2 commits intodevfrom
feature/add-exception-logging

Conversation

@unam98
Copy link
Copy Markdown
Collaborator

@unam98 unam98 commented Apr 30, 2026

작업 배경

  • POST /api/course 에서 HTTP 500이 지속 발생하나 ControllerExceptionAdvice.handleException이 Slack/Sentry로만 에러를 전달하고 서버 로그(nohup.out)에는 아무것도 남기지 않는 구조
  • Slack 설정이 새 계정 환경에서 동작하지 않아 실제 예외 원인을 전혀 확인할 수 없는 상황

변경 사항

파일 변경 내용
ControllerExceptionAdvice.java handleExceptionlog.error("[500 ERROR] {} {}", method, uri, error) 추가
  • Slack/Sentry 전송 전에 먼저 서버 로그에 예외 전체 스택 트레이스 기록

영향 범위

  • 500 에러 발생 시 nohup.out에 스택 트레이스 출력됨
  • 기존 Slack/Sentry 전송 동작 변경 없음
  • 런타임 성능 영향 없음

Test Plan

  • feature 브랜치 커밋 확인
  • 배포 후 POST /api/course 실패 시 nohup.out에 스택 트레이스 출력 확인
  • 원인 파악 후 실제 버그 수정 PR 별도 진행

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error handling with improved request logging and context
    • Refined error response generation and message clarity in exception management

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Warning

Rate limit exceeded

@unam98 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 53 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fae3a711-b4fb-4856-80af-e9e9d38483b2

📥 Commits

Reviewing files that changed from the base of the PR and between 8cbc935 and 2c997f0.

📒 Files selected for processing (2)
  • .github/workflows/dev-ci.yml
  • src/main/java/org/runnect/server/common/advice/ControllerExceptionAdvice.java
📝 Walkthrough

Walkthrough

A single exception handler class is modified with changes to HTTP status mappings, error response returns, and enhanced error logging that includes request metadata alongside exception details.

Changes

Cohort / File(s) Summary
Exception Handler Updates
src/main/java/org/runnect/server/common/advice/ControllerExceptionAdvice.java
Modified HTTP status annotation for IllegalArgumentException handler, altered error response return statement in servlet parameter handler, and enhanced generic exception handler with additional request method/URI logging and error message updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through error flows,
Catching exceptions as it goes,
With status codes and logs so bright,
The handlers dance through day and night,
New traces bloom in Sentry's sight! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[Debug] 500 에러 원인 파악을 위한 예외 핸들러 로깅 추가' clearly describes the main change: adding exception handler logging to diagnose 500 errors, which aligns with the PR's objective of enhancing logging in ControllerExceptionAdvice.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/add-exception-logging

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
Review rate limit: 0/1 reviews remaining, refill in 48 minutes and 53 seconds.

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

@unam98 unam98 force-pushed the feature/add-exception-logging branch from 2f86464 to 84c6284 Compare April 30, 2026 15:33
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a 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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/main/java/org/runnect/server/common/advice/ControllerExceptionAdvice.java`:
- Around line 63-64: The handler method handleMissingRequestParameterException
currently calls returnApiResponseDto.error(...) which is a typo causing a
missing return and undefined identifier; change that call to return
ApiResponseDto.error(...) so the method returns an ApiResponseDto built with
ErrorStatus.VALIDATION_REQUEST_PARAMETER_MISSING_EXCEPTION and the formatted
message using e.getParameterName(); ensure the method signature
(MissingServletRequestParameterException e) remains unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f03f37b7-50db-40b8-a87a-3145e36de329

📥 Commits

Reviewing files that changed from the base of the PR and between 4065d6d and 8cbc935.

📒 Files selected for processing (1)
  • src/main/java/org/runnect/server/common/advice/ControllerExceptionAdvice.java

Comment thread src/main/java/org/runnect/server/common/advice/ControllerExceptionAdvice.java Outdated
@unam98 unam98 merged commit dfe865a into dev Apr 30, 2026
2 checks passed
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.

1 participant