Communitygithub.com

YepAPI/skills

구조화된 오류, React 오류 경계, 그리고 우아한 성능 저하

skills란 무엇인가요?

이 스킬은 애플리케이션에서 발생하는 오류를 구조화된 방식으로 처리하고, React 오류 경계(Error Boundaries)를 통해 크래시 복구를 지원하며, 사용자 경험을 저해하지 않도록 우아한 성능 저하(Graceful Degradation)를 구현하는 방법을 제공합니다. 주요 기능으로는 `AppError`와 같은 사용자 정의 오류 클래스를 통해 일관된 오류 코드와 HTTP 상태 코드를 반환하고, React 컴포넌트에서 오류 발생 시 fallback UI를 표시하여 앱이 완전히 중단되는 것을 방지합니다. 또한 네트워크 오류(502, 429 등)에 대해 지수 백오프(Exponential Backoff)로 최대 3회 재시도하고, 유효성 검증 오류 시 즉시 400 응답을 반환하며, 오류를 무시하지 않고 사용자 ID, 요청 ID, 타임스탬프, 오류 코드 등 맥락 정보와 함께 로깅합니다. 이 스킬은 모든 React 기반 프론트엔드 및 Node.js 백엔드 환경에서 사용 가능하며, 안정적인 서비스 운영과 사용자 친화적인 오류 메시지 제공에 필수적입니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/error-handling

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

오류 처리

규칙

  • 구조화된 오류 타입: class AppError extends Error { code: string; statusCode: number }
  • React의 오류 경계(Error Boundary)를 통한 크래시 복구 — fallback UI 표시, 오류 로깅
  • 우아한 성능 저하(Graceful Degradation): 기능 실패 시 메시지 표시, 앱 중단 없음
  • 사용자 친화적인 메시지: "문제가 발생했습니다"와 같은 메시지, 스택 트레이스 노출 금지
  • 맥락 정보와 함께 오류 로깅: 사용자 ID, 요청 ID, 타임스탬프, 오류 코드
  • 일시적 오류(네트워크, 502, 429)에 대해 지수 백오프(Exponential Backoff)로 재시도 — 최대 3회
  • 유효성 검증 오류 시 즉시 실패 처리 — 400 응답 반환, 추가 처리 중단
  • 빈 catch 블록으로 오류를 무시하지 않음 — 최소한 로깅은 수행

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

관련 스킬