API Error Handler
Implement consistent API error handling with proper status codes, error formats, and global middleware.
Usage
Describe your API framework and error handling needs, and this skill will design the error handling system.
Examples
- "Implement RFC 7807 error responses for my Express API"
- "Create a global error handler that catches all unhandled exceptions"
- "Design an error code system for my multi-service API"
Guidelines
- Use a consistent error response format across all endpoints
- Map errors to appropriate HTTP status codes
- Include error codes for programmatic error handling by clients
- Never expose internal error details or stack traces to clients
- Log detailed error information server-side for debugging