error-handling-patterns

Implement error handling patterns across Python, TypeScript, Rust, and Go.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps developers master robust error handling strategies to build resilient applications that gracefully manage failures and provide excellent debugging experiences.

Core Features & Use Cases

  • Error Handling Philosophies: Understand exceptions, Result types, error codes, and Option/Maybe types.
  • Language-Specific Patterns: Implement custom exception hierarchies, context managers, retry mechanisms (Python), Result types, async error handling (TypeScript), and Result/Option types (Rust), explicit error returns (Go).
  • Universal Patterns: Learn Circuit Breaker, Error Aggregation, and Graceful Degradation.
  • Use Case: When implementing a new feature that interacts with an external API, use this Skill to ensure proper error handling, retries, and fallback mechanisms are in place to maintain application stability.

Quick Start

Use the error-handling-patterns skill to implement a custom exception hierarchy in Python for your application.

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 calls?

A circuit breaker pattern prevents cascading failures by blocking requests to failing services. You implement it by wrapping external API calls in a state monitor that trips open after threshold failures, providing fallback mechanisms to maintain application stability.

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

Exceptions interrupt normal control flow for unexpected errors, while Result types force explicit error handling as return values. Result types make error propagation visible in function signatures, preventing unhandled failures and improving debugging experiences across your application.

How do I create a custom exception hierarchy in Python for application errors?

Creating a custom exception hierarchy in Python involves defining base exception classes that inherit from Exception, then subclassing for specific domains. This structure improves debugging by categorizing failures and enabling targeted error handling strategies throughout your application.

What is graceful degradation and when should I use it?

Graceful degradation allows applications to maintain partial functionality during failures by providing fallback responses. You should use it when interacting with external APIs or non-critical services where returning reduced functionality is preferable to complete application crashes.

Does this error handling guidance work with TypeScript and Rust?

Yes, the guidance covers TypeScript, Rust, Python, and Go. It includes language-specific patterns like async error handling for TypeScript, Result and Option types for Rust, explicit error returns for Go, and custom exception hierarchies for Python.

Why should I use error aggregation instead of failing on the first error?

Error aggregation collects multiple validation or processing failures into a single result instead of stopping at the first. This approach is useful for batch operations and user input validation, providing comprehensive feedback rather than requiring repeated retry cycles.