error-handling-patterns

Explain error handling patterns with code examples for Python, TypeScript, Rust, and Go.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/DuveSalo/app --skill error-handling-patterns-duvesalo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling-patterns
Source: https://github.com/DuveSalo/app/tree/main/.claude/skills/error-handling-patterns
Command: npx skills add https://github.com/DuveSalo/app --skill error-handling-patterns-duvesalo

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps developers implement robust error handling strategies across various programming languages to build more reliable and fault-tolerant applications.

Core Features & Use Cases

  • Understand Error Philosophies: Learn about exceptions, result types, and error codes.
  • Implement Language-Specific Patterns: See examples for Python, TypeScript/JavaScript, Rust, and Go.
  • Apply Universal Patterns: Utilize Circuit Breaker, Error Aggregation, and Graceful Degradation.
  • Follow Best Practices: Adopt strategies for fail-fast, context preservation, and resource cleanup.
  • Avoid Common Pitfalls: Recognize and steer clear of issues like swallowing errors or catching too broadly.
  • Use Case: When developing a microservice that interacts with external APIs, use the Circuit Breaker pattern to prevent cascading failures if an external service becomes unavailable.

Quick Start

Use the error-handling-patterns skill to generate a Python example for custom exception hierarchy.

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 a circuit breaker pattern for external API failures?

Implement the circuit breaker pattern to prevent cascading failures when external services become unavailable. It monitors calls and trips the circuit to stop requests, allowing graceful degradation and improving overall system resilience.

What's the best way to handle errors in Rust and Go?

Handle errors in Rust and Go using Result types and error values rather than exceptions. This pattern forces explicit error checking at the call site, ensuring robust error propagation and preventing unhandled runtime failures.

How does error aggregation work for building fault-tolerant applications?

Error aggregation works by collecting multiple errors into a single composite error object. This allows comprehensive context preservation across operations, preventing individual failures from aborting entire workflows in resilient applications.

Why does swallowing exceptions cause problems in Python and TypeScript?

Swallowing exceptions causes problems because it hides failures by catching too broadly without rethrowing. This leads to silent data corruption and unpredictable application state, making debugging and fault tolerance extremely difficult.

Can I use result types instead of exceptions for robust API design?

Yes, you can use result types instead of exceptions for robust API design. Result types represent explicit success or error states in the return value, avoiding control flow disruptions and making error handling predictable across language boundaries.

How do I create a custom exception hierarchy for graceful degradation?

Create a custom exception hierarchy by defining domain-specific error classes that inherit from a base exception. This enables graceful degradation by allowing targeted catch blocks to handle specific failures while preserving error context.