error-handling-patterns

Define AppError hierarchies and standardize error handling across API, service, and frontend layers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill standardizes error handling patterns across all layers of an application to ensure consistent, informative, and secure error management.

Core Features & Use Cases

  • Defines a base error class and domain-specific errors (AppError, ValidationError, NotFoundError, UnauthorizedError, ForbiddenError, ConflictError, RateLimitError) to model failures clearly.
  • Provides database, service, API, and frontend patterns to translate, propagate, and present errors consistently.
  • Includes guidance for error boundaries, global error handlers, and structured logging to differentiate operational vs programming errors.

Quick Start

Define the error hierarchy in your codebase, implement a central error handling middleware or router, and apply consistent error responses across API, service, and frontend layers.

Frequently Asked Questions about error-handling-patterns

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

FAQPage Schema
How do I standardize TypeScript error handling across API and frontend layers?

To standardize TypeScript error handling, define a base AppError class and domain-specific errors like ValidationError and NotFoundError, then implement central middleware to translate and propagate errors consistently across API, service, and frontend boundaries.

What is the best way to design a TypeScript error hierarchy for API backends?

The best way to design a TypeScript error hierarchy is creating an AppError base class extended by specialized errors such as UnauthorizedError, ConflictError, and RateLimitError, clearly modeling API failures and ensuring informative, secure error responses across service layers.

How do frontend error boundaries work with consistent API error management?

Frontend error boundaries work with API error management by catching unhandled exceptions at the UI layer, translating propagated service errors into user-friendly messages, and differentiating operational failures from programming errors to allow applications to fail gracefully.

Can I use this error handling approach for both service layers and frontend boundaries?

Yes, this error handling approach applies to both service layers and frontend boundaries. It provides database, service, API, and frontend patterns to translate, propagate, and present errors consistently across all application layers.

When should I differentiate operational errors from programming errors in exception design?

Differentiate operational errors from programming errors during exception design when implementing structured logging and global error handlers, ensuring operational failures are managed gracefully while programming errors are caught to prevent application instability.