error-handler

Implement standardized AppError handling and logging across Next.js API routes, server actions, and UI error boundaries.

Updated Jan 8, 2026
One-click install
npx skills add https://github.com/Arnutt-N/hr-ims --skill error-handler-arnutt-n
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handler
Source: https://github.com/Arnutt-N/hr-ims/tree/main/.claude/skills/error-handler
Command: npx skills add https://github.com/Arnutt-N/hr-ims --skill error-handler-arnutt-n

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

HR-IMS requires a consistent, centralized approach to error handling across server actions, API routes, and UI components, with clear user feedback and robust logging.

Core Features & Use Cases

  • Unified error models (AppError hierarchy)
  • Server action and API error handling with structured responses
  • Client-side error boundaries, error pages, and server-side logging
  • Useful in production apps to surface meaningful errors while protecting sensitive data

Quick Start

Configure and integrate the error-handler by importing the utilities into server actions, API handlers, and a React error boundary to automatically catch and report errors.

Frequently Asked Questions about error-handler

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

FAQPage Schema
How do I handle API and server action errors consistently in Next.js?

You can handle API and server action errors consistently in Next.js by implementing a centralized AppError hierarchy with structured responses and wrappers for server actions. This standardizes backend error management and logging.

What is the best way to log server-side errors without exposing sensitive data?

The best way to log server-side errors without exposing sensitive data is to use a centralized error logger that processes standardized AppError instances. This captures meaningful production errors while protecting sensitive user information.

How do I set up error boundaries for client-side UI errors in a React application?

You can set up error boundaries for client-side UI errors by integrating dedicated error-boundary components and error pages. These automatically catch runtime UI errors and display safe fallback feedback to the user.

Can I use a unified error model for both REST API routes and UI components?

Yes, you can use a unified error model for REST API routes and UI components. An AppError hierarchy provides standardized error objects across backend API routes, server actions, and frontend React boundaries.

How do I catch and format errors in Next.js server actions?

You catch and format errors in Next.js server actions by applying specialized error-handling wrappers. These wrappers intercept failures, format them into structured AppError responses, and trigger centralized logging.