API Error Handling

•
5
•

Standardizes API error responses and status codes to improve client-side recovery and system observability.

The API Error Handling skill provides Claude with expert-level guidance for designing and implementing robust error responses based on industry standards like RFC 7807 and RFC 7231. It ensures your APIs communicate failures effectively by enforcing the correct use of 4xx and 5xx status codes, implementing machine-readable error codes instead of fragile string messages, and providing actionable recovery guidance through Retry-After headers. This skill is essential for developers looking to build professional, developer-friendly APIs that are easy to debug and integrate, while avoiding common anti-patterns like generic 500 errors or inconsistent response formats.

主な機能

01Enforces consistent JSON error structures across all endpoints
02Integrates X-Request-ID headers for production tracing and debugging
03Provides transient error recovery guidance with Retry-After headers
045 GitHub stars
05Standardizes HTTP status code selection (4xx vs. 5xx distinction)
06Implements machine-readable error codes for programmatic handling

ユースケース

01Improving API documentation by defining specific error states and recovery paths.
02Refactoring legacy error messages into a standardized RFC 7807 'Problem Details' format.
03Designing a global error-handling middleware for a REST or GraphQL backend.