Skip to main content

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, exception filters, error responses, error logging, or recovery strategies.

Datos de origen

Repositorio
shipshitdev/shipcode
Última actividad en el origen
10 de julio de 2026 a las 11:20
Idioma detectado de SKILL.md
inglés
Estrellas
6
Forks
0

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Explorador de archivos
3 archivos

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
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.
metadata
{"version":"1.0.0","tags":"errors, reliability, architecture"}
# 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 ```typescript { "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 ```typescript @Catch() export class AllExceptionsFilter implements ExceptionFilter { catch(exception: unknown, host: ArgumentsHost) { // Log, format, respond } } ``` ### React Error Boundary ```typescript class ErrorBoundary extends React.Component { componentDidCatch(error, errorInfo) { // Log to monitoring } } ``` ### Retry with Backoff ```typescript 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`
Ver en GitHub