error-handling

Guides error handling design decisions for throwing, returning, and structuring failures in code.

96|8|Updated Aug 13, 2026
One-click install
npx skills add https://github.com/pingfanfan/hello-dsh --skill error-handling-pingfanfan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/pingfanfan/hello-dsh/tree/main/examples/skills/error-handling
Command: npx skills add https://github.com/pingfanfan/hello-dsh --skill error-handling-pingfanfan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases often suffer from silent failures, swallowed exceptions, and errors that callers cannot distinguish, making debugging painful and failures invisible. This Skill provides a decision framework for designing error handling so failures are visible, distinguishable, and actionable. ## Core Features & Use Cases - Throw vs Return Decisions: Decide whether a failure should be thrown or returned based on whether it is part of normal business flow. - Distinguishable Error Design: Create structured error classes with codes and context instead of relying on fragile message-text matching. - Failure Safety Patterns: Preserve cause chains, clean up resources with finally blocks, and define clear partial-failure semantics for batch operations. - Use Case: When reviewing a service that catches a structured sandbox error and rethrows a generic SEARCH_FAILED, use this Skill to identify the information loss and redesign the error propagation so callers retain the original cause. ## Quick Start Review the error handling in my module and tell me which failures should be thrown versus returned and how to make them distinguishable.

Frequently Asked Questions about error-handling

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

FAQPage Schema
How should error messages differ for users versus developers?▼

User-facing messages should state what happened and what to do next without exposing internal structure, credentials, or paths. Developer logs should retain full context such as session IDs, operation steps, and the underlying cause.