error-handling

Implement structured error classes, boundaries, and logging in TypeScript applications.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Naw3/skillsrepo --skill error-handling-naw3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/Naw3/skillsrepo/tree/main/error-handling
Command: npx skills add https://github.com/Naw3/skillsrepo --skill error-handling-naw3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides structured patterns and utilities for building robust error handling in production apps, including error boundaries, API error handling, logging, and user-friendly messaging.

Core Features & Use Cases

  • Error class hierarchy: Centralized AppError and derived classes (ValidationError, NotFoundError, UnauthorizedError, ForbiddenError, etc.) to standardize error shapes.
  • Client & server error handling: Error boundaries for UI resilience and route/server error handling patterns for APIs.
  • Logging & user-friendly messaging: Structured logging and user-friendly messages to avoid leaking internals while aiding debugging.
  • Use Case: Implement consistent error handling across a Next.js app with pages, API routes, and server actions.

Quick Start

Copy or install this skill into your project, import the shared error classes and boundary components, and start wrapping operations and API endpoints with the provided patterns to ensure predictable failures and friendly feedback.

Frequently Asked Questions about error-handling

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

FAQPage Schema
How do I implement consistent error handling across a Next.js app?

You implement consistent error handling by wrapping pages, API routes, and server actions with shared error classes and boundary components. This skill provides production-grade patterns to standardize error shapes and ensure predictable failures throughout your application.

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

Standardizing API error responses in TypeScript is best achieved using a centralized AppError class hierarchy. Derived classes like ValidationError, NotFoundError, and UnauthorizedError standardize error shapes for consistent API failures.

How do error boundaries work for UI resilience in client-side applications?

Error boundaries work for UI resilience by catching rendering errors and displaying user-friendly messages instead of crashing. This skill provides boundary components to isolate failures and maintain a resilient client-side user experience during unexpected errors.

Do I need external dependencies to use these robustness patterns?

No external dependencies are needed to use these robustness patterns. This error-handling skill requires only standard TypeScript and JavaScript tooling, implementing defined error classes, boundaries, and centralized logging without additional libraries.

How do I avoid leaking internal API errors to users while logging them for debugging?

Avoid leaking internal API errors by implementing structured logging alongside user-friendly messaging. This skill separates internal debugging logs from the messages displayed to users, ensuring secure error handling without exposing application internals.