← ClaudeAtlas

backend-error-handlinglisted

Implement solid error handling patterns. Use when adding error handling, improving error UX, debugging error flows, standardizing error responses, or when user mentions "error boundary", "try/catch", "error state", "toast notification", "form validation error", or "API error handling".
kensaurus/cursor-kenji · ★ 4 · Web & Frontend · score 80
Install: claude install-skill kensaurus/cursor-kenji
# Error Handling Skill full error handling patterns for full-stack applications. ## When to Use - Adding error handling to new features - Improving error user experience - Standardizing error responses - Debugging error propagation - Adding error monitoring ## CRITICAL: Check Existing First **Before adding ANY error handling, verify:** 1. **Check for existing error types:** ```bash rg "type.*Error|interface.*Error" --type ts rg "ActionResult|ApiError" --type ts ``` 2. **Check for existing error boundaries:** ```bash ls -la app/error.tsx app/global-error.tsx rg "ErrorBoundary" --type tsx ``` 3. **Check for existing error utilities:** ```bash rg "formatError|handleError|reportError" --type ts ls -la src/lib/errors* src/lib/error* 2>/dev/null # @/lib/errors ``` 4. **Check established error response patterns:** ```bash rg "success: false|error:" src/features/*/server/ --type ts | head -10 ``` **Why:** Inconsistent error handling confuses users and complicates debugging. Always follow established patterns. ## Error Handling Layers ``` ┌─────────────────────────────────────────┐ │ UI Layer │ │ - Error boundaries │ │ - Form validation errors │ │ - Toast notifications │ ├─────────────────────────────────────────┤ │ Application Layer │ │ - Server Action errors │ │ - API route errors │ │ - Business logic errors │ ├─────────────────────────────────────────┤ │ Data Layer │ │ - Database errors │ │ - Validation errors (Zod) │ │ - External API errors │ └─────────────────────────