error-handling

Implement typed error classes and guard clauses across TypeScript, Python, Go, and Rust.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/lgili/skillex --skill error-handling-lgili
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/lgili/skillex/tree/main/skills/error-handling
Command: npx skills add https://github.com/lgili/skillex --skill error-handling-lgili

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Robust error handling patterns that help developers fail loudly, recover gracefully, and communicate actionable guidance to users and operators. It provides guard-clause discipline, typed error hierarchies, and contextual messages to prevent silent failures across API calls, input parsing, filesystem access, and database interactions.

Core Features & Use Cases

  • Guard clauses and early returns to keep code readable and predictable.
  • Typed error classes (e.g., ValidationError, NotFoundError) with contextual data for precise error reporting.
  • Cross-language guidance for TypeScript, Python, Go, and Rust with idiomatic patterns.
  • Structured error messages and logging templates for developers and operators.
  • Reference material covering error patterns, messages, and language-specific practices.

Quick Start

Describe and implement robust error handling in your codebase using language-specific patterns and clear, contextual messages.

Frequently Asked Questions about error-handling

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

FAQPage Schema
How do I implement robust error handling to prevent silent failures in API integrations?

Robust error handling in API integrations uses typed error classes and guard clauses at entry points to prevent silent failures. This approach provides actionable feedback and contextual data to ensure failures are loud, recoverable, and communicate precise guidance to operators.

What is the best way to structure typed errors across TypeScript, Python, Go, and Rust?

Structuring typed errors across TypeScript, Python, Go, and Rust requires using named error classes or discriminated unions with clear contextual messages. This cross-language strategy ensures precise error reporting and idiomatic pattern consistency across diverse software projects.

How do guard clauses improve input validation and code predictability?

Guard clauses improve input validation by enforcing early returns at function entry, keeping code readable and predictable. This discipline halts invalid execution immediately, preventing silent failures and ensuring only valid data progresses through your logic.

Does this error-handling approach work for file I/O and database interactions?

This error-handling approach works effectively for file I/O and database interactions by applying typed error hierarchies and structured messages. It prevents silent failures during filesystem access and database operations by requiring clear contextual feedback and edge-case tests.

Why do I need named error classes instead of standard exceptions for input parsing?

Named error classes are needed instead of standard exceptions for input parsing to provide precise error reporting and actionable guidance. Typed errors like ValidationError carry contextual data, preventing silent failures and enabling structured tests to validate edge cases.

When should I not use discriminated unions for error handling?

You should not use discriminated unions for error handling when your language lacks native support, as seen in Python or Go. In these cases, utilize named error classes and guard clauses to achieve robust error prevention and actionable contextual messages.