Feat(#290): 렌더링 에러 바운더리(ErrorBoundary) 도입#294
Open
stringnine wants to merge 1 commit into
Open
Conversation
- 범용 ErrorBoundary 클래스 컴포넌트 추가 (getDerivedStateFromError + componentDidCatch) - 라우트 errorElement용 RouteErrorBoundary 추가 (기존 ServerErrorPage 재활용) - 최상단 폴백 RootErrorFallback 추가 (라우터 미존재 상황 대비, window.location 기반) - main.tsx 최상단 래핑 및 routes.tsx 루트 라우트 errorElement 연결
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthrough렌더 단계에서 발생하는 예외를 안전하게 처리하기 위해 ErrorBoundary를 도입합니다. 라우트 레벨과 최상단 레벨에서 각각 다른 폴백 UI를 표시하며, 라우터 컨텍스트 유무에 따라 적절한 복구 메커니즘을 제공합니다. Changes에러 바운더리 구현 및 통합
Sequence DiagramsequenceDiagram
participant User as 사용자
participant App as 애플리케이션
participant RootEB as RootErrorBoundary
participant Router as 라우터
participant RouteEB as RouteErrorBoundary
participant Component as 페이지 컴포넌트
User->>App: 페이지 로드/네비게이션
App->>RootEB: 렌더 시작
RootEB->>Router: 정상 진행
Router->>RouteEB: errorElement 설정
RouteEB->>Component: 라우트 렌더링
alt 라우터 내부 에러
Component-->>RouteEB: 예외 발생
RouteEB->>RouteEB: useRouteError() 수집
RouteEB-->>User: ServerErrorPage 표시
else 라우터 외부 에러
App-->>RootEB: 예외 발생
RootEB->>RootEB: 폴백 상태 전환
RootEB-->>User: RootErrorFallback 표시
User->>User: 새로고침 버튼 클릭
User->>User: window.location.reload()
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 관련 이슈
🏷️ PR 타입
📝 작업 내용
렌더 단계 예외로 앱 전체가 흰 화면(white screen)으로 죽는 문제를 막기 위해 2겹 ErrorBoundary 안전망을 도입했습니다.
ErrorBoundary클래스 컴포넌트 추가 (getDerivedStateFromError+componentDidCatch, 폴백·로깅·reset 지원)errorElement용RouteErrorBoundary추가 — 라우터 트리 내부 렌더/로더 에러를 잡아 기존ServerErrorPage(500) 재활용 (SPA 네비게이션 유지)RootErrorFallback추가 — provider/ToastHost 등 라우터 바깥 catastrophic 에러 대비 (window.location기반)main.tsx최상단을<ErrorBoundary>로 래핑,routes.tsx루트 라우트에errorElement연결console.error로깅 — 추후 Sentry 등 외부 로깅 연동 지점(// TODO) 표시동작 방식
errorElement가 잡아 500 페이지 폴백 (홈으로 버튼 동작)✅ 체크리스트
공통
pnpm tsc --noEmit타입 체크를 통과했습니다type/이슈번호-작업명)📎 기타 참고사항
throw로 라우트 경계가 500 페이지로 폴백되는 것 및 콘솔 로깅을 로컬에서 검증했습니다.Summary by CodeRabbit
릴리스 노트