What problem does it solve?
Inconsistent error handling leads to information leakage (stack traces to users),
lost debugging context (no logs), and confusing API responses. This skill establishes a
single error-handling pattern used by every endpoint and service.
Core Features & Use Cases
- Error classes: A hierarchy of AppError types (NotFoundError, ValidationError, UnauthorizedError, ForbiddenError, ConflictError) with portable codes and details.
- Error handler middleware: Catches AppError and returns structured JSON with proper HTTP status; unknown errors are logged and return a generic 500.
- Guardrails & health checks: Enforces logging rules, request context, and includes a health-check endpoint to exercise error handling.
Quick Start
Implement the AppError hierarchy and error-handler middleware in your project, then expose a health-check endpoint to exercise the pattern.