Skip to content

feat: 404 not-found 페이지 및 Sentry 로깅 추가#284

Merged
JeLee-river merged 3 commits into
devfrom
feat/not-found-sentry
Jul 8, 2026
Merged

feat: 404 not-found 페이지 및 Sentry 로깅 추가#284
JeLee-river merged 3 commits into
devfrom
feat/not-found-sentry

Conversation

@jaeyoung-kwon

Copy link
Copy Markdown
Contributor

개요

없는 경로 접근 시 표시되는 404 not-found 페이지를 신설하고, 해당 진입을 Sentry에 기록합니다. 기존엔 defaultNotFoundComponent가 없어 TanStack Router 기본 화면으로 떨어졌고, 404는 Sentry로도 수집되지 않았습니다.

변경 사항

  • main.tsxcreateRouterdefaultNotFoundComponent: NotFound 등록
  • pages/system/components/NotFoundCard.tsx — 404 프레젠테이셔널 UI (기존 MaintenanceCard/RequireLoginCard 스타일, 홈으로 돌아가기)
  • pages/system/components/NotFound.tsx — 마운트 시 Sentry 로깅 후 NotFoundCard 렌더 (사이드이펙트/뷰 분리)
  • libs/sentry/sentryUtils.tscaptureNotFound({ path }) 추가 (고정 메시지 Route not found + error_type: NOT_FOUND 태그 + path extra)
  • libs/sentry/beforeSend.tsclassifyErrorNOT_FOUND 분기 추가 (priority: P2, level: warning) — 기존 API_ERROR/RENDER_CRASH/JS_RUNTIME 분류 체계에 편입
  • libs/sentry/beforeSend.test.ts — 분류 로직 유닛 테스트 신설 (5 케이스)

동작

매칭 안 되는 경로 → NotFound 렌더 → captureNotFound 1회 발사 → beforeSendNOT_FOUND로 분류. 대시보드에서 error_type:NOT_FOUND 필터 + extra.path로 어떤 URL이 404를 내는지 집계 가능합니다.

참고

  • Sentry는 프로덕션에서만 init되므로(if (isProduction) initSentry) 실제 이벤트는 배포 후 확인 가능합니다. 로컬에선 404 화면 렌더만 확인됩니다.

테스트

  • beforeSend 유닛 테스트 5/5 통과 (NOT_FOUND / 5xx·4xx ApiError / 렌더 크래시 / 폴백)
  • 로컬 dev에서 없는 경로 접근 → 404 카드 렌더 및 홈 버튼 이동 확인
  • type-check · lint 통과

🤖 Generated with Claude Code

@jaeyoung-kwon jaeyoung-kwon left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 PR Review

✅ 확실하게 수정이 필요한 항목을 찾지 못했습니다.

defaultNotFoundComponent 등록, captureNotFound를 통한 Sentry 로깅, beforeSend의 NOT_FOUND 분류 분기가 서로 일관되게 연결되어 있고, 새 유닛 테스트 5건이 각 분류 케이스(NOT_FOUND/5xx/4xx/렌더 크래시/폴백)를 커버합니다. NotFoundCard는 기존 MaintenanceCard/RequireLoginCard 패턴을 그대로 따르고 있어 스타일 일관성도 유지됩니다. 프로덕션 이슈로 이어질 만한 고신호 결함은 발견하지 못했습니다.

🚨 0 Critical · ⚠️ 0 Major · 📝 0 Minor

📋 검증 과정
  • Claude structured review 결과 중 확신도가 있는 항목만 정리했습니다.
  • Critical/Major는 inline comment로 게시하고, Minor는 참고 항목으로 summary에 포함합니다.
  • 자동 생성된 OpenAPI 타입 선언 파일과 lock 파일은 리뷰 대상에서 제외합니다.

🤖 Claude PR Review


Generated by Claude Code

@jaeyoung-kwon jaeyoung-kwon changed the title [BOM-없음] feat: 404 not-found 페이지 및 Sentry 로깅 추가 feat: 404 not-found 페이지 및 Sentry 로깅 추가 Jul 2, 2026
@JeLee-river

Copy link
Copy Markdown
Contributor

오 테스트 추가 좋네요 ㅎㅎ

한 가지 질문이 있는데요, 404를 센트리로 캡쳐하도록 하신 이유가 있으신지 궁금합니다! 사용자가 단순히 url을 잘못 입력한 경우도 잡힐거 같은데, 노이즈가 크지 않을까 해서요!

@JeLee-river

Copy link
Copy Markdown
Contributor

음 그래도 저희 서비스에서 자주나는 오류를 생각해보면 노이즈보다는 센트리로 페이지가 깨지는 이슈를 잡는 이득이 더 클 것 같기도 하네요 ㅎㅎ

@JeLee-river JeLee-river 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.

404 페이지 좋은데요?!! 작업해주셔서 감사합니다! ㅎㅎ

@JeLee-river JeLee-river merged commit c41ba90 into dev Jul 8, 2026
3 checks passed
@JeLee-river JeLee-river deleted the feat/not-found-sentry branch July 8, 2026 14:18
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.

2 participants