error-handling - Error Handling for APIs and Services
Add structured error handling with try/catch, context logging, and user-facing error mapping
Tags
Updated: 2026-02-12Capabilities
Typical Inputs
Typical Outputs
What this skill does
- wrap async operations in try/catch
- log errors with context
- map errors to HTTP status codes
- create user-facing error messages
- rethrow errors with wrapper types
- sanitize error messages for logging
- apply security review for sensitive code
Inputs
- new services
- API handlers
- integrations
- async operations
- external calls
- error objects
- request IDs
- user IDs
Outputs
- code with try/catch blocks
- structured error logs
- consistent error mapping
- user-facing error responses
- HTTP error status codes
- sanitized error messages
Requirements
- when adding new services, integrations, or API handlers
- security review for sensitive code paths
