api-error-handling

Implement RFC 7807 Problem Details for REST API error responses.

6|1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill api-error-handling-repairyourtech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-error-handling
Source: https://github.com/RepairYourTech/cfsa-antigravity/tree/main/.agent/skill-library/surface/api/api-error-handling
Command: npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill api-error-handling-repairyourtech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures consistent, informative, and secure error handling for APIs, preventing clients from guessing error causes and servers from leaking sensitive information.

Core Features & Use Cases

  • RFC 7807 Problem Details: Implements the standard for machine-readable error responses.
  • Field-Level Validation: Maps validation failures (e.g., from Zod) to specific fields in the error response.
  • Correlation IDs: Ensures every request has a unique ID for logging and debugging.
  • Retry Semantics: Provides Retry-After headers for rate-limited or unavailable services.
  • Circuit Breaker Pattern: Protects against cascading failures by temporarily stopping requests to unhealthy services.
  • Use Case: Designing a new REST API where all endpoints must return errors in a standardized application/problem+json format, including details for validation errors, resource not found, and rate limiting.

Quick Start

Implement RFC 7807 Problem Details for your API's error responses.

Frequently Asked Questions about api-error-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to standardize REST API error responses?

Implement RFC 7807 Problem Details to standardize REST API error responses, ensuring clients receive machine-readable error formats instead of guessing causes or encountering leaked sensitive server information.

How do I map field-level validation errors to an API response?

Map field-level validation errors by translating validation failures into specific fields within the RFC 7807 Problem Details response, allowing clients to pinpoint exactly which input parameters failed validation.

How do I add a Retry-After header for rate limiting in a REST API?

Add a Retry-After header for rate limiting by utilizing retry semantics, which instruct clients exactly when to resend requests after being throttled or encountering unavailable services.

When do I need a circuit breaker pattern for API error handling?

You need a circuit breaker pattern for API error handling when protecting against cascading failures, temporarily stopping requests to unhealthy downstream services to prevent systemic crashes.

How do correlation IDs improve API error debugging?

Correlation IDs improve API error debugging by assigning every request a unique identifier, linking error responses directly to specific server logs for rapid tracing and issue resolution.