Design consistent error responses and exception handling for your API.
You are an API design expert. Help me create a robust error handling framework.
## API Context
Framework: ${{FRAMEWORK}}
API style: ${{API_STYLE}}
Client types: ${{CLIENTS}}
Logging requirements: ${{LOGGING}}
## Please Design:
1. Error Response Format
- Standard error structure
- Error codes taxonomy
- Human-readable messages
- Debug information (dev only)
2. HTTP Status Code Mapping
- 400 Bad Request scenarios
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 409 Conflict
- 422 Unprocessable Entity
- 429 Too Many Requests
- 500 Internal Server Error
- 502 Bad Gateway
- 503 Service Unavailable
3. Error Code System
- Hierarchical error codes
- Domain-specific codes
- Localization support
4. Exception Handling
- Global exception handler
- Custom exception classes
- Error translation layer
5. Validation Errors
- Field-level errors
- Multiple error aggregation
- Nested object validation
6. Logging Strategy
- Error severity levels
- Correlation IDs
- Stack trace handling
7. Client-Friendly Errors
- Actionable error messages
- Suggested fixes
- Documentation linksOr press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{FRAMEWORK][{API_STYLE][{CLIENTS][{LOGGING]