error-handling-patterns

Standardize exceptions, result types, propagation, and cleanup across Python, TypeScript, Rust, and Go workflows.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/Jhabbig/Habbig --skill error-handling-patterns-jhabbig
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling-patterns
Source: https://github.com/Jhabbig/Habbig/tree/main/.claude/plugins/wshobson/developer-essentials/skills/error-handling-patterns
Command: npx skills add https://github.com/Jhabbig/Habbig --skill error-handling-patterns-jhabbig

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design resilient software that anticipates failures, preserves context, and keeps applications stable under real-world conditions.

Core Features & Use Cases

  • Exception and Result Modeling: Choose the right error style for expected failures, unexpected bugs, and recoverable edge cases.
  • Propagation and Cleanup: Safely pass errors upward while ensuring transactions, files, and network resources are always released.
  • Retries, Circuit Breakers, and Fallbacks: Improve reliability in distributed systems by recovering from transient failures and degrading gracefully.
  • Use Case: A service that calls external APIs can validate input early, wrap service-specific failures in typed errors, retry timeouts, and return a safe fallback when downstream systems are unavailable.

Quick Start

Use this skill to review my codebase and rewrite its error handling so it uses clear custom errors, safe cleanup, and resilient fallback behavior.

Frequently Asked Questions about error-handling-patterns

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

FAQPage Schema
What's the best way to handle errors and exceptions in async API calls?

Handling errors in async API calls requires wrapping service-specific failures in typed custom errors, implementing retries for timeouts, and returning safe fallbacks for graceful degradation when downstream systems are unavailable.

How do I implement a circuit breaker for transient failures in distributed systems?

Implementing a circuit breaker for transient failures involves standardizing exception propagation, safely cleaning up network resources, and applying fallback behavior to ensure applications remain stable during recoverable downstream failures.

Should I use result types or exceptions for validation failures in Python or TypeScript?

Using result types or exceptions depends on the failure context: result modeling suits expected validation failures and recoverable edge cases, while typed custom exceptions handle unexpected bugs and preserve contextual logging for production requirements.

Does this error handling approach work with Rust and Go workflows?

This error handling approach supports Rust and Go workflows by standardizing typed custom errors, contextual logging, and safe resource cleanup across Python, TypeScript, Rust, and Go to satisfy production reliability requirements.

How do I ensure resource cleanup and safe recovery when file operations fail?

Ensuring resource cleanup when file operations fail requires safely passing errors upward through propagation while guaranteeing that transactions, files, and network resources are always released during safe recovery from recoverable failures.