error-handling-patterns

Guide software error handling pattern selection with language-specific approaches.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/smileynet/code-spice --skill error-handling-patterns-smileynet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling-patterns
Source: https://github.com/smileynet/code-spice/tree/main/skills/error-handling-patterns
Command: npx skills add https://github.com/smileynet/code-spice --skill error-handling-patterns-smileynet

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers choose the most effective strategies for signaling, handling, and recovering from errors in their software, leading to more robust and maintainable applications.

Core Features & Use Cases

  • Strategy Selection: Guides decisions between exceptions, result types, error codes, and other patterns.
  • Recoverability Analysis: Helps determine if errors are recoverable and how callers should respond.
  • API Design: Provides insights into designing error-handling APIs that are clear and enforceable.
  • Use Case: When building a new API endpoint, use this Skill to decide whether to use checked exceptions, Result types, or nullable returns for potential failure scenarios, ensuring callers are aware of and can handle errors appropriately.

Quick Start

Use the error-handling-patterns skill to understand the tradeoffs between checked exceptions and result types.

Frequently Asked Questions about error-handling-patterns

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

FAQPage Schema
What is the best way to handle errors in API design?

Error handling in API design requires choosing between explicit and implicit signaling strategies like exceptions, result types, or error codes to ensure callers can properly handle recoverability and maintain robust software reliability.

How do I decide between using exceptions and result types for error handling?

Choosing between exceptions and result types depends on your language's approach, such as Go's errors-as-values or TypeScript's discriminated unions. Analyze tradeoffs between explicit signaling and recoverability frameworks to select the most maintainable pattern.

How do I determine if a software error is recoverable?

To determine if an error is recoverable, analyze the error context within your recoverability framework to decide if the caller can safely respond or if the failure requires terminating the operation for software reliability.

How do I properly wrap third-party errors in my application?

Wrapping third-party errors involves applying error handling patterns that translate external failures into your application's explicit signaling structure, preventing common antipatterns and preserving the original context for robust API design.

What are common error handling antipatterns I should avoid?

Common error handling antipatterns include using implicit signaling when explicit error reporting is required, ignoring recoverability analysis, and leaking unwrapped third-party errors, all of which degrade software robustness and maintainability.