Command Palette

Search for a command to run...

Назад к скиллам
скилл № 17720

frontend-error-handling

Use when the user asks about React error boundaries, Vue errorHandler, Angular ErrorHandler, svelte:boundary, fallback UI, retry and recovery, unhandled…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить frontend-error-handling в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Frontend Error Handling

Purpose

Catch, report, and recover from frontend errors without crashing the entire app. Error boundaries isolate failures. Users always see a functional fallback UI. Every error is reported to the monitoring service with context for debugging.

Agent Protocol

Trigger

Exact phrases: "error handling", "error boundary", "error recovery", "graceful degradation", "fallback UI", "error reporting", "error logging", "crash recovery", "error state", "retry pattern", "error fallback".

Input Context

  • Framework (React, Vue, Angular, Svelte)
  • Current error handling (if any) — try/catch patterns, boundaries
  • Error reporting service (Sentry, Datadog RUM, LogRocket, custom)
  • Critical vs non-critical components that need boundaries

Output Artifact

Error boundary implementation, error reporting integration, fallback UI components, recovery patterns.

Response Format

## Strategy
<boundary-locations, reporting-service, fallback-hierarchy>

## Implementation
<error-boundary-code, error-reporting-setup>

## Recovery
<retry-patterns, fallback-ui, reset-mechanism>

—
Compression footer: frontend-error-handling/v1 | boundaries: <count> | reporter: <service> | fallback: <full|partial>

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.

Completion Criteria

  • Error boundaries wrap: root layout, each major route, each standalone widget
  • Fallback UI provides: error message, retry action, and contact/support link
  • Errors reported to monitoring service with stack trace, component stack, breadcrumbs
  • Non-critical resource failures degrade gracefully (hide widget vs crash page)
  • Async errors caught and displayed inline where they occur
  • Recovery mechanisms in place (retry, reset boundary, navigate away)
  • Development-only error overlay suppressed in production

Max Response Length

4096 tokens

Error Handling Architecture / Decision Trees

Boundary Placement Decision Tree

Where does the error occur?
  |-- Root layout / shell -->
  |     REQUIRE: RootErrorBoundary with full-page fallback + "Reload" button
  |     FAILSAFE: If RootBoundary itself crashes, show static error.html
  |
  |-- Route-level (page component) -->
  |     REQUIRE: RouteErrorBoundary with page-level fallback
  |     OPTION: Retry button calls router.push(sameRoute) to remount
  |
  |-- Widget / section (sidebar, widget, embedded component) -->
  |     REQUIRE: WidgetErrorBoundary with inline fallback
  |     BEHAVIOR: Hide widget, show degraded message, rest of page works
  |
  |-- Async operation (fetch, timeout, abort) -->
  |     REQUIRE: try/catch + throw to boundary OR inline error state
  |     OPTION: useErrorBoundary hook to throw from async code
  |
  |-- Event handler (onClick, onChange) -->
  |     REQUIRE: try/catch within handler -- boundaries DO NOT catch event handlers
  |     ACTION: Report error, show toast notification to user
  |
  |-- Third-party script (analytics, ads, embeds) -->
        REQUIRE: Wrap in isolated sandbox (iframe) -- never let third-party JS crash host app
        ACTION: Log warning, continue without the third-party feature

Error Recovery Decision Tree

User sees error state.
  |-- Is it a transient error? (network timeout, server 503) -->
  |     |-- YES: Show "Retry" button + auto-retry (up to 3 times with exponential backoff)
  |     |-- NO: Show "Try again" button, but don't auto-retry
  |
  |-- Is the error in a non-critical widget? -->
  |     |-- YES: Hide widget, degrade gracefully, rest of page works
  |     |-- NO: Show full-page or route-level fallback
  |
  |-- Has the user retried 3+ times without success? -->
        |-- YES: Show permanent error screen with support contact info
        |-- NO: Allow another retry

Error Reporting Triage Decision Tree

What type of error is this?
  |-- Network error (fetch failed, timeout, abort) -->
  |     REPORT? NO -- too noisy, these are expected in poor connectivity
  |     ACTION: Track count as metric, not individual event
  |
  |-- Application error (TypeError, ReferenceError, null access) -->
  |     REPORT? YES -- with stack trace, component stack, breadcrumbs
  |     PRIORITY: medium (user-impacting)
  |
  |-- Third-party script error -->
  |     REPORT? CONDITIONAL -- only if it impacts user experience
  |     FILTER: Known third-party errors should be filtered in beforeSend
  |
  |-- AbortError (cancelled requests from rapid navigation) -->
        REPORT? NO -- this is normal user behavior
        FILTER: return null in Sentry beforeSend

Workflow

1. Error Boundary Placement

<RootBoundary>             ← catches anything not caught below: show full-page crash screen
  <Layout>
    <RouteBoundary>        ← catches per-route errors: render route-specific fallback
      <Outlet />
    </RouteBoundary>
    <WidgetBoundary>       ← catches widge
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/error-boundaries.md
  • references/error-boundary-patterns.md
  • references/error-logging-best-practices.md
  • references/error-monitoring.md
  • references/error-reporting.md
  • references/error-ui-patterns.md

FAQ

Что делает скилл frontend-error-handling?

Use when the user asks about React error boundaries, Vue errorHandler, Angular ErrorHandler, svelte:boundary, fallback UI, retry and recovery, unhandled promise rejections or reporting frontend errors to Sentry. Produces layered error boundaries and user-facing recovery. Not for form validation messages (use frontend-form-handling).

Как установить скилл frontend-error-handling?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл frontend-error-handling запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить frontend-error-handling с