error-handling

Implement type-safe error handling with context preservation and cleanup.

6|1|Updated Apr 26, 2025
One-click install
npx skills add https://github.com/edobry/minsky --skill error-handling-edobry
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/edobry/minsky/tree/main/.claude/skills/error-handling
Command: npx skills add https://github.com/edobry/minsky --skill error-handling-edobry

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Error handling guidance focusing on type-safe errors, structured error objects, graceful degradation, context preservation, resource cleanup, timeouts, and user-friendly error messages.

Core Features & Use Cases

  • Type-safe errors with contextual information
  • Structured error objects and error causes
  • Graceful degradation with fallbacks
  • Resource cleanup and operation timeouts
  • Actionable, user-facing messages for CLI and API errors
  • Diagnostic templates for MCP tool errors and debugging

Quick Start

Apply the error-handling templates to your codebase to ensure type-safe errors and clear user guidance.

Frequently Asked Questions about error-handling

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

FAQPage Schema
What is type-safe error handling and how does it preserve context?

Type-safe error handling uses structured error objects and typed classes to preserve context. It enforces design patterns that chain error causes, ensuring diagnostic information is maintained across API clients, filesystem operations, and background tasks.

How do I implement graceful degradation with fallbacks for API errors?

You can implement graceful degradation by applying structured error handling templates that provide fallbacks for API and network errors. This ensures your application maintains functionality and delivers user-facing messaging when operations fail.

Does this error handling approach work for CLI tools and background tasks?

Yes, this approach works for CLI tools and background tasks. It provides actionable, user-facing messaging for CLI errors and covers filesystem errors, resource cleanup, and operation timeouts required by background processing.

What is the best way to structure user-facing error messages for APIs?

The best way to structure user-facing error messages is using consistent messaging templates. These templates enforce actionable guidance for API and CLI errors, ensuring users receive clear instructions instead of raw diagnostic data.

How do I handle resource cleanup and timeouts during network operations?

You handle resource cleanup and timeouts by applying the enforced design patterns from the error handling templates. These patterns ensure structured errors manage operation timeouts and resource release during API and filesystem failures.