error-handling-patterns

Standardize error handling patterns across Python and TypeScript/JavaScript.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/yusoofsh/dotfiles --skill error-handling-patterns-yusoofsh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling-patterns
Source: https://github.com/yusoofsh/dotfiles/tree/main/home/dot_claude/private_plugins/private_marketplaces/claude-code-workflows/plugins/developer-essentials/skills/error-handling-patterns
Command: npx skills add https://github.com/yusoofsh/dotfiles --skill error-handling-patterns-yusoofsh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to implementing robust error handling across various programming languages, helping you build resilient applications that gracefully recover from failures and provide clear debugging insights.

Core Features & Use Cases

  • Language-Specific Patterns: Master exceptions (Python, JS), Result/Option types (TypeScript, Rust), and explicit error returns (Go).
  • Retry & Circuit Breaker: Implement strategies for handling transient failures and preventing cascading system outages.
  • Graceful Degradation: Design fallbacks to maintain partial functionality even when critical components fail.
  • Error Aggregation: Collect and report multiple validation errors instead of failing on the first one.
  • Use Case: Improve the reliability of a microservice by implementing retries for external API calls, a circuit breaker for a flaky database, and graceful degradation for non-critical features.

Quick Start

Use the error-handling-patterns skill to generate Python code for a custom ApplicationError hierarchy, including ValidationError and NotFoundError.

Frequently Asked Questions about error-handling-patterns

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

FAQPage Schema
How do I implement error handling across Python and TypeScript in a microservice?

Error handling standardization reduces failures in multi-language stacks by using language-specific patterns: Python's custom exception hierarchies and context managers, TypeScript's Result types and custom errors. Define consistent error propagation, then apply retry logic and circuit breakers for transient failures and external API calls to maintain reliability.

What's the difference between exceptions and Result types for error handling?

Exceptions interrupt control flow and suit Python and JavaScript for synchronous errors; Result types (TypeScript, Rust) make errors explicit values, enabling composition and forcing callers to handle failures. Choose exceptions for expected failures in Python, Result types for TypeScript to prevent uncaught errors in async workflows.

How do I implement retry logic with exponential backoff?

Retry logic with exponential backoff handles transient failures by re-attempting failed requests with increasing delays. Python supports this via custom decorators and context managers; configure retry count, initial delay, and backoff multiplier. Apply to external API calls and database operations to avoid cascading outages.

What's a circuit breaker and when should I use one?

A circuit breaker prevents cascading system outages by stopping requests to failing services after a threshold, then gradually resuming traffic. Implement one for flaky databases, slow external APIs, or any dependency prone to temporary failure. Monitor state transitions and alert when circuits open.

How do I collect multiple validation errors instead of failing on the first one?

Error aggregation collects all validation errors before returning, improving user feedback and debugging. Accumulate errors in a list during validation, then return or raise a single exception containing all failures. Apply to form validation, configuration parsing, and API request schemas.

Can I use graceful degradation to maintain functionality when critical components fail?

Graceful degradation maintains partial service availability by providing fallbacks when critical features fail. Distinguish recoverable errors (retry, use cached data, reduce features) from unrecoverable ones (propagate immediately). Apply to feature flags, cached responses, and non-critical service dependencies.