Skip to content
OpenSmartRoute
Skillv1.0.0

error-handling-expert

Expert in error handling patterns, exception management, error responses, logging, and error recovery strategies for React, Next.js, and NestJS applications. Use when implementing error handling, exce

by shipshitdev(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from shipshitdev/skills (skills/error-handling-expert/SKILL.md). Install upstream with npx skills add shipshitdev/skills --skill error-handling-expert. Copyright stays with the author.

Error Handling Expert Skill

When to Use

  • Implementing error handling
  • Creating exception filters
  • Designing error responses
  • Setting up error logging
  • Implementing error recovery
  • Handling async errors
  • Creating error boundaries
  • Implementing retry logic

Project Context Discovery

Before providing guidance:

  1. Check .agents/memory/ for project architecture and error patterns
  2. Review existing exception filters
  3. Check for error monitoring (Sentry, Rollbar)
  4. Review logging libraries (Winston, Pino)

Core Principles

Error Types

Application Errors: 400, 401, 403, 404, 409, 422 System Errors: 500, 502, 503, 504

Error Response Format

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Validation failed",
    "details": [...],
    "timestamp": "2025-01-01T00:00:00Z",
    "path": "/api/users",
    "requestId": "req-123456"
  }
}

Quick Patterns

NestJS Exception Filter

@Catch()
export class AllExceptionsFilter implements ExceptionFilter {
  catch(exception: unknown, host: ArgumentsHost) {
    // Log, format, respond
  }
}

React Error Boundary

class ErrorBoundary extends React.Component {
  componentDidCatch(error, errorInfo) {
    // Log to monitoring
  }
}

Retry with Backoff

async function retryWithBackoff<T>(fn, maxRetries = 3): Promise<T>

Best Practices

  • User-friendly messages, no sensitive info
  • Log all errors with context
  • Integrate error monitoring (Sentry)
  • Implement retry logic and circuit breakers
  • Provide fallback values
  • Test error cases

Recovery Strategies

  1. Retry Logic - Exponential backoff
  2. Circuit Breaker - Prevent cascade failures
  3. Fallback Values - Graceful degradation

For complete exception filter implementations, custom exceptions, validation pipe setup, error boundaries, circuit breaker pattern, logging integration, and database/API error patterns, see: references/full-guide.md

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/shipshitdev-skills-error-handling-expert/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

shipshitdev-skills-error-handling-expert.ocm.jsonjson
{
  "ocm": "1",
  "id": "shipshitdev-skills-error-handling-expert",
  "kind": "skill",
  "name": "error-handling-expert",
  "description": "Expert in error handling patterns, exception management, error responses, logging, and error recovery strategies for React, Next.js, and NestJS applications. Use when implementing error handling, exception filters, error responses, error logging, or recovery strategies.",
  "publisher": "shipshitdev",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "errors",
      "reliability",
      "architecture",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Expert in error handling patterns, exception management, error responses, logging, and error recovery strategies for React, Next.js, and NestJS applications. Use when implementing error handling, exception filters, error responses, error logging, or recovery strategies."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/shipshitdev/skills",
      "path": "skills/error-handling-expert/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/shipshitdev/skills/blob/HEAD/skills/error-handling-expert/SKILL.md",
      "key": "shipshitdev/skills/skills/error-handling-expert/SKILL.md"
    }
  },
  "instructions": "# Error Handling Expert Skill\n\n## When to Use\n\n- Implementing error handling\n- Creating exception filters\n- Designing error responses\n- Setting up error logging\n- Implementing error recovery\n- Handling async errors\n- Creating error boundaries\n- Implementing retry logic\n\n## Project Context Discovery\n\nBefore providing guidance:\n\n1. Check `.agents/memory/` for project architecture and error patterns\n2. Review existing exception filters\n3. Check for error monitoring (Sentry, Rollbar)\n4. Review logging libraries (Winston, Pino)\n\n## Core Principles\n\n### Error Types\n\n**Application Errors:** 400, 401,",
  "cost": {
    "context_tokens": 504
  }
}

Fetch it by URL: GET /api/v1/registry/shipshitdev-skills-error-handling-expert/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.