error-handler

Standardize exception management with custom error classes and structured logging for TypeScript and Python.

9|1|Updated Dec 1, 2025
One-click install
npx skills add https://github.com/benshapyro/cadre-devkit-claude --skill error-handler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handler
Source: https://github.com/benshapyro/cadre-devkit-claude/tree/main/skills/error-handler
Command: npx skills add https://github.com/benshapyro/cadre-devkit-claude --skill error-handler

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides battle-tested error handling patterns, including custom error classes, structured responses, and best practices for logging and propagation.

Core Features & Use Cases

  • Custom Error Classes: TypeScript and Python error classes (AppError, ValidationError, NotFoundError, DatabaseError)
  • Error Response Formats: Consistent client-facing error payloads
  • Logging & Propagation: Structured logging and safe propagation

Quick Start

Implement a ValidationError for bad input and wrap unknown errors in a DatabaseError

Frequently Asked Questions about error-handler

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

FAQPage Schema
How do I implement custom error classes in TypeScript and Python?

Custom error classes standardize exception handling across your codebase. Create typed error subclasses like ValidationError, NotFoundError, and DatabaseError that extend a base AppError class, allowing you to catch and handle specific error types with structured context and meaningful messages.

What's the best way to handle errors in API backends and web services?

Use consistent error response formats with structured logging and safe propagation. Define custom error classes for domain-specific failures, wrap unknown exceptions, log context-rich messages, and return predictable client-facing payloads so frontend and backend communicate failures reliably.

How do I implement error logging and propagation strategies?

Structured logging captures error context at each layer while propagation strategies determine when to retry, fail gracefully, or clean up resources. Combine typed errors, context enrichment, and logging patterns to trace failures through API calls and service integrations without losing diagnostic information.

Can I use error handling patterns across both TypeScript and Python?

Yes. This Skill provides battle-tested patterns and custom error class structures applicable to both TypeScript and Python, letting you maintain consistent exception management practices across mixed-language backends, web services, and frontend-backend integrations.

Do I need retry logic and resource cleanup in my error handling?

Retry logic and resource cleanup are critical for resilient services. The Skill covers strategies for retrying transient failures, ensuring proper cleanup on error paths, and implementing graceful degradation so your application remains stable when failures occur.

How do validation errors differ from database errors in error handling?

Validation errors catch bad user input early with actionable messages, while database errors indicate infrastructure or query failures requiring different recovery paths. Separating them into distinct custom error classes enables precise handling, logging, and client feedback for each failure type.