API Error Handler

СреднийdevelopmentМинимальный контекст: 16K

Designs and implements comprehensive error handling for APIs. Covers error response formats (RFC 7807 Problem Details), HTTP status code selection, error logging strategies, retry logic, and client-friendly error messages with proper i18n support.

Варианты использования

  • Implementing global error handlers in Express/NestJS/FastAPI
  • Designing error response schemas (RFC 7807)
  • Creating error code catalogs for APIs
  • Building retry-aware error responses with Retry-After headers
  • Implementing error boundary patterns in frontend apps

Пример промпта

Design an error handling system for my API.

Framework: [e.g., NestJS / Express / FastAPI]
Requirements:
- RFC 7807 Problem Details format
- Proper HTTP status codes for each error type
- Error codes for client consumption (e.g., AUTH_001)
- Structured logging (don't leak internals to clients)
- Rate limit errors with Retry-After header
- Validation errors with field-level details

Please provide:
1. Error response schema/interface
2. Global error handler middleware
3. Custom error classes (NotFound, Validation, Auth, RateLimit)
4. Error code catalog
5. Example usage in a controller

Рекомендуемые модели

Совместимые инструменты

claude-codecursorgithub-copilotkiroany

Модальности

Вход: text, code
Выход: code, text

Похожие Skills

Автор

OpenModels Community

@openmodelsrun