Back to Skills

error-handling

verified

Comprehensive error handling patterns for robust applications including custom errors, error boundaries, recovery strategies, and user-facing error messages. Use this skill when designing error hierarchies, implementing React error boundaries, adding retry logic or fallbacks, creating API error responses, integrating error tracking (Sentry), or improving user error communication. Triggers on "error handling", "error boundary", "custom error", "retry logic", "graceful degradation", "error tracking", "Sentry", "user error message", "try-catch", "Result type", "circuit breaker".

View on GitHub

Marketplace

pokayokay

srstomp/pokayokay

Plugin

pokayokay

productivity

Repository

srstomp/pokayokay
2stars

plugins/pokayokay/skills/error-handling/SKILL.md

Last Verified

January 23, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/srstomp/pokayokay/blob/main/plugins/pokayokay/skills/error-handling/SKILL.md -a claude-code --skill error-handling

Installation paths:

Claude
.claude/skills/error-handling/
Powered by add-skill CLI

Instructions

# Error Handling

Design resilient applications through intentional error handling strategies.

## Error Handling Philosophy

```
┌─────────────────────────────────────────────────────────────────┐
│                    Error Handling Goals                         │
├─────────────────┬─────────────────┬─────────────────────────────┤
│   Debuggable    │   Recoverable   │      User-Friendly          │
│ "What failed?"  │ "Can we retry?" │    "What should I do?"      │
├─────────────────┼─────────────────┼─────────────────────────────┤
│ Rich context    │ Retry logic     │ Clear, actionable messages  │
│ Stack traces    │ Fallbacks       │ Appropriate detail level    │
│ Correlation IDs │ Circuit breaker │ Recovery guidance           │
└─────────────────┴─────────────────┴─────────────────────────────┘
```

**Core principle:** Errors are data, not just exceptions. Design them intentionally.

## Quick Decision Guide

| Situation | Pattern | Reference |
|-----------|---------|-----------|
| Need typed error categories | Custom error classes | [error-patterns.md](references/error-patterns.md) |
| Want explicit error handling (no throws) | Result/Either type | [error-patterns.md](references/error-patterns.md) |
| React component might crash | Error boundary | [react-errors.md](references/react-errors.md) |
| API endpoint error response | Structured API errors | [api-errors.md](references/api-errors.md) |
| Network calls that might fail | Retry with backoff | [recovery-patterns.md](references/recovery-patterns.md) |
| Downstream service unreliable | Circuit breaker | [recovery-patterns.md](references/recovery-patterns.md) |
| Feature can work without dependency | Graceful degradation | [recovery-patterns.md](references/recovery-patterns.md) |

## Error Type Design

### Custom Error Classes

```typescript
// Base error with context
class AppError extends Error {
  constructor(
    message: string,
    public readonly code: string,
    public readonly context?: Record<string, 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
13283 chars