error-handling-patterns

Implement fail-fast error handling with Truss assertions and Telemere logging.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/pyze/claude-plugin --skill error-handling-patterns-pyze
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling-patterns
Source: https://github.com/pyze/claude-plugin/tree/main/skills/error-handling-patterns
Command: npx skills add https://github.com/pyze/claude-plugin --skill error-handling-patterns-pyze

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you implement robust error handling strategies that make problems visible during development, preventing silent failures and improving system reliability.

Core Features & Use Cases

  • Fail-Fast Philosophy: Prioritizes immediate error detection over silent fallbacks.
  • Assertion-Based Validation: Uses Taoensso Truss for inline, context-aware assertions at system boundaries.
  • Structured Logging: Leverages Taoensso Telemere for clear, contextual error reporting.
  • Use Case: When developing a new API endpoint, use this Skill to ensure all inputs are validated at the entry point, configuration is checked during initialization, and any exceptions are logged with full context before being rethrown.

Quick Start

Implement fail-fast error handling for a new function by adding Truss assertions at its entry point.

Frequently Asked Questions about error-handling-patterns

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

FAQPage Schema
How do I implement fail-fast error handling to prevent silent failures in my application?

Fail-fast error handling prevents silent failures by enforcing immediate error detection at system boundaries. You implement it by placing inline assertions at entry points to validate inputs and configuration, ensuring errors are visible during development before cascading.

How do I validate inputs at API boundaries using assertions?

Input validation at API boundaries uses assertion-based checks to enforce data integrity immediately upon receipt. By applying inline assertions at entry points, invalid data is caught and rejected before processing begins, ensuring system reliability.

Does Truss work with asynchronous code for exception handling?

Truss supports safe exception handling in both synchronous and asynchronous code. It provides patterns to classify retryable versus non-retryable errors, allowing you to manage exceptions predictably across concurrent operations.

What is the best way to add structured logging to error handling?

Structured logging for error handling is best implemented using Telemere to capture clear, contextual error reports. This approach logs exceptions with full context before rethrowing them, preventing lost debugging information during failures.

When should I use fail-fast validation instead of silent fallbacks in system design?

Fail-fast validation should be used during development and at system boundaries to expose problems immediately. Silent fallbacks mask underlying issues; prioritizing immediate error detection improves system reliability by preventing undefined states.

How do I classify retryable vs non-retryable errors during exception handling?

Classifying retryable vs non-retryable errors involves evaluating exception types within your handling patterns. You categorize transient issues as retryable and permanent failures as non-retryable, allowing your system to recover safely or halt appropriately.