error-handling-patterns

Classify transient versus permanent failures to choose retry or fail-fast strategies.

3|2|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/JayRHa/AgentSkills --skill error-handling-patterns-jayrha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling-patterns
Source: https://github.com/JayRHa/AgentSkills/tree/main/error-handling-patterns
Command: npx skills add https://github.com/JayRHa/AgentSkills --skill error-handling-patterns-jayrha

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Designs robust, production-grade error handling by providing a decision framework to distinguish transient vs permanent failures, choose between results and exceptions, and apply retries, timeouts, circuit breakers, and graceful degradation across code that interacts with networks, databases, and external APIs.

Core Features & Use Cases

  • Decision framework for failure classification (transient vs permanent vs ambiguous).
  • Deterministic patterns: exponential backoff with jitter, timeouts, circuit breakers, bulkheads, idempotent retries.
  • Guidance for graceful degradation and observability across services and teams.

Quick Start

Implement resilience by applying the retry, timeout, circuit-breaker, and graceful degradation patterns described.

Frequently Asked Questions about error-handling-patterns

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

FAQPage Schema
How do I distinguish transient vs permanent failures when handling API errors?

To distinguish transient vs permanent failures during API error handling, apply a decision framework that classifies exceptions based on retry eligibility, then route ambiguous cases to targeted fail-fast logic or exponential backoff with jitter.

What's the best way to implement retry logic with exponential backoff and circuit breakers in Python?

The best way to implement retry logic with exponential backoff and circuit breakers in Python is using deterministic patterns from reusable scripts that combine timeouts, jitter, and bulkheads to prevent cascading failures across network calls.

When do I need idempotency for retry mechanisms handling network calls?

You need idempotency for retry mechanisms handling network calls when operations might execute multiple times due to transient failures, ensuring safe duplicate requests without data corruption across database queries and external API integrations.

How does graceful degradation work with circuit breaker patterns for fault tolerance?

Graceful degradation works with circuit breaker patterns for fault tolerance by isolating failing services through bulkheads, allowing dependent code paths to return fallback responses instead of propagating exceptions during outages.

Can I use this error handling decision framework for database queries and file I/O?

Yes, you can use this error handling decision framework for database queries and file I/O, as it applies deterministic timeout and retry patterns across any code path performing network calls or external integrations requiring reliable operation.

Why do my retries fail without timeouts and observability for external API integrations?

Retries fail without timeouts and observability for external API integrations because lacking measurable monitoring prevents proper failure classification, causing indefinite blocking or blind retry loops that degrade overall system resilience.