error-handling

Standardize typed error classes, global handlers, and structured logging across Node/Express and React.

Updated Dec 13, 2025
One-click install
npx skills add https://github.com/imehr/vet --skill error-handling-imehr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/imehr/vet/tree/main/.claude/skills/error-handling
Command: npx skills add https://github.com/imehr/vet --skill error-handling-imehr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides the design and implementation of resilient error-handling, observability, and graceful recovery to minimize downtime and simplify debugging across backend and frontend layers.

Core Features & Use Cases

  • Typed error models with a base AppError and specialized subclasses (BadRequestError, UnauthorizedError, NotFoundError, ConflictError, ValidationError, etc.) to standardize responses.
  • A global error handler and structured logging that attach context (requestId, path, method) and sanitize responses in production.
  • Recovery and resilience patterns including retry strategies, fallbacks, timeouts, and graceful degradation to keep systems available during partial failures.
  • Frontend error boundaries and UI patterns to gracefully surface errors without crashing the app and provide recovery options.
  • Best practices: always handle errors, log with context, avoid leaking sensitive data, and test error paths.

Quick Start

Introduce typed error classes, wire a centralized error handler in your server or app, and add structured logging to demonstrate end-to-end error flows.

Frequently Asked Questions about error-handling

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

FAQPage Schema
How do I implement structured error handling in a Node backend?

Structured error handling in a Node backend uses typed error classes and a global handler to standardize responses. This approach attaches request context to logs and sanitizes outputs to simplify debugging and minimize downtime.

What's the best way to standardize API error responses in TypeScript?

Standardizing API error responses in TypeScript involves creating a base AppError class with specialized subclasses like BadRequestError and NotFoundError. This typed model ensures consistent error payloads across backend and frontend layers.

How do I add resilience patterns like retry and fallback to a backend application?

Adding resilience patterns to a backend application involves implementing retry strategies, timeouts, and graceful degradation. These recovery mechanisms keep systems available during partial failures by providing fallbacks instead of crashing.

Can I use error boundaries to gracefully handle React frontend crashes?

Error boundaries can gracefully handle React frontend crashes by catching errors without unmounting the app. This UI pattern surfaces errors safely to users and provides recovery options to maintain application availability.

How does structured logging improve backend observability during failures?

Structured logging improves backend observability by attaching contextual metadata like requestId, path, and method to error logs. This contextual data traces end-to-end error flows, accelerating root cause analysis and debugging.

What are the best practices for sanitizing error data in production environments?

Sanitizing error data in production environments requires avoiding sensitive data leakage in responses and logs. Always handle errors centrally, attach necessary context securely, and test error paths to ensure compliance and safety.