error-handling

Standardize error handling across systems with validation, logging, and recovery strategies.

381|48|Updated Aug 12, 2025
One-click install
npx skills add https://github.com/rsmdt/the-startup --skill error-handling-rsmdt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/rsmdt/the-startup/tree/main/plugins/team/skills/cross-cutting/error-handling
Command: npx skills add https://github.com/rsmdt/the-startup --skill error-handling-rsmdt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes error handling across systems, promoting clear error types, user-friendly messages, and robust recovery strategies.

Core Features & Use Cases

  • Input validation: Fail-fast with comprehensive error reporting.
  • Error types: Distinct classifications for operational vs programmer errors.
  • Recovery patterns: Retry, fallback, and compensation approaches.

Quick Start

Introduce a ValidationError type and update API responses to include specific error codes and messages.

Frequently Asked Questions about error-handling

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

FAQPage Schema
How do I implement consistent error handling across my application?

Error handling consistency standardizes how your system responds to failures. Define distinct error types separating operational errors (expected failures like invalid input) from programmer errors (code bugs), implement fail-fast validation at system boundaries, and structure responses with specific error codes and user-friendly messages. This approach enables predictable recovery and clearer debugging.

What's the best way to validate input and report multiple errors at once?

Collect-all-errors validation gathers every validation failure before responding, rather than stopping at the first error. Return structured error responses listing all issues with specific codes and messages, enabling clients to fix problems in one pass. This improves user experience and reduces round-trip validation cycles.

How do I distinguish between transient failures and permanent errors?

Operational errors—like timeouts or temporary service unavailability—warrant retry or fallback strategies, while programmer errors require immediate failure and logging. Classify errors by type and root cause, then apply appropriate recovery: exponential backoff retries for transient issues, fallback services for degraded dependencies, and compensation logic for partial failures.

Why should I use structured logging with correlation IDs in error handling?

Structured logging with correlation IDs tracks requests across system boundaries, linking all events related to a single operation. This enables faster debugging, clearer error traces in distributed systems, and better monitoring. Correlation IDs distinguish between concurrent requests and illuminate failure chains across services.

Can I use retry and fallback patterns together?

Yes. Retry patterns handle transient failures by attempting the operation again, while fallback patterns invoke an alternative service or cached response when retries exhaust. Combining them—retry first, then fallback—provides defense in depth: retry recovers from temporary blips, and fallback maintains availability during sustained outages.

What error codes and messages should I include in API responses?

API error responses should include a specific error code identifying the failure type, a concise message describing what went wrong, and context like field names or validation rules that failed. Standardized codes enable clients to handle errors programmatically; clear messages help users understand and correct problems without support tickets.