mcpField
E
error-handling-expert

error-handling-expert

github.com/shipshitdevDevelopment38174 installsUpdated 2d ago
Repository

About error-handling-expert

A skill that guides developers through implementing and reviewing application error handling, from response formats and logging to recovery patterns. It covers backend exceptions, React error boundaries, and asynchronous failures.

Key features

  1. 01Exception filters and error responses
  2. 02Logging and monitoring guidance
  3. 03Retry and circuit-breaker patterns
  4. 04Fallback and recovery strategies
  5. 05Project-context discovery

Use cases

  1. 01Designing consistent API error responses
  2. 02Adding exception filters or React error boundaries
  3. 03Planning retries and graceful degradation

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/shipshitdev/skills --skill error-handling-expert

After installing, type/error-handling-expertin Claude Code to confirm it loaded.

Bundled filesplugin.jsonreferences/full-guide.md

Details

From the project README

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

Comments

Markdown supported