docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거

Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
Antigravity Agent
2026-07-05 00:33:48 +09:00
parent 1cfd3bbb56
commit 9148c358d0
6455 changed files with 1 additions and 86875 deletions
@@ -0,0 +1,77 @@
---
id: react-error-boundary
title: React Error Boundary 패턴
category: Coding
status: draft
source_trust_level: B
verification_status: conceptual
created_at: 2026-05-09
updated_at: 2026-05-09
tags: [react, error-handling, resilience, vibe-coding]
tech_stack: { language: "TypeScript / React 18+", applicable_to: ["Web", "React Native"] }
applied_in: []
aliases: [componentDidCatch, fallback UI, react-error-boundary]
---
# React Error Boundary 패턴
> render / lifecycle / constructor 에서 throw 된 에러를 잡아 fallback UI 표시. **이벤트 핸들러 / async / setTimeout 에러는 안 잡음** — 그건 일반 try/catch.
## 📖 핵심 개념
- Class component 만 가능 (Hook 형태 없음). `react-error-boundary` 라이브러리 함수 컴포넌트 wrapper.
- 경계마다 isolated fallback. 트리 일부만 죽고 나머지 살아남기.
## 💻 코드 패턴
### react-error-boundary 라이브러리
```tsx
import { ErrorBoundary } from 'react-error-boundary';
function Fallback({ error, resetErrorBoundary }: any) {
return <div role="alert">
<p>: {error.message}</p>
<button onClick={resetErrorBoundary}> </button>
</div>;
}
<ErrorBoundary FallbackComponent={Fallback}
onError={(err, info) => sendToSentry(err, info)}
onReset={() => resetCacheKeys()}>
<Dashboard />
</ErrorBoundary>
```
### Suspense + ErrorBoundary 조합
```tsx
<ErrorBoundary FallbackComponent={Fallback}>
<Suspense fallback={<Spinner />}>
<UserProfile id={id} />
</Suspense>
</ErrorBoundary>
```
## 🤔 의사결정 기준
| 영역 | Error Boundary | try/catch |
|---|---|---|
| 컴포넌트 render 중 throw | ✅ | — |
| useEffect 안의 async 에러 | ❌ | ✅ |
| 이벤트 핸들러 (onClick) | ❌ | ✅ |
| Suspense fallback 안의 throw | ✅ | — |
| Server-side rendering 에러 | 부분 (Next.js error.tsx) | — |
| 전역 unhandled rejection | ❌ | window.onunhandledrejection |
## ❌ 안티패턴
- **앱 루트에 하나만**: 한 컴포넌트 사고 = 전체 화면 흰색. 화면 영역마다 boundary.
- **fallback 에서 동일 에러 다시 throw**: 무한 루프.
- **에러 silently 삼킴**: 로깅 / 모니터링 (Sentry/Datadog) 필수.
- **이벤트 핸들러 에러를 boundary 가 잡을 거라 가정**: 안 잡힘. 핸들러는 try/catch.
- **resetErrorBoundary 호출 시 같은 에러 재발생**: 원인을 안 고치면 다시 throw. cache key reset / state reset 필수.
- **production 에서 error.message 그대로 노출**: 보안 위험. 일반 메시지 + 내부 로깅 분리.
## 🤖 LLM 활용 힌트
- "data fetching 자식 마다 ErrorBoundary + Suspense 페어" 패턴 강제.
- onError 에서 Sentry 등 외부 서비스 보고 명시.
## 🔗 관련 문서
- [[React_Suspense_for_Data]]
- [[Error_Handling_Result_vs_Throw]]