1natsu-error-handling

Implement structured error handling for JavaScript/TypeScript API handlers and middleware.

1|Updated Oct 30, 2017
One-click install
npx skills add https://github.com/1natsu172/dotfiles --skill 1natsu-error-handling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 1natsu-error-handling
Source: https://github.com/1natsu172/dotfiles/tree/main/.agents/skills/1natsu-error-handling
Command: npx skills add https://github.com/1natsu172/dotfiles --skill 1natsu-error-handling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevent silent failures by enforcing structured error propagation across layers (domain, infrastructure, and presentation), with clear boundaries and recoverable paths.

Core Features & Use Cases

  • Define domain-specific errors and transform infra errors into unified domain errors.
  • Apply boundary-level handling in API handlers and middleware to return meaningful responses.
  • Use granular try-catch blocks to isolate error sources and improve debuggability.

Quick Start

Validate an operation by outlining potential failure points, implement domain and boundary errors, and add a boundary handler to produce consistent responses.

Frequently Asked Questions about 1natsu-error-handling

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

FAQPage Schema
How do I prevent silent failures in TypeScript and JavaScript applications?

Prevent silent failures by implementing structured error propagation across application layers, using custom error types and boundary-aware catch blocks to ensure errors reach the presentation layer for logging and meaningful API responses.

What is the best way to handle errors across API handlers and middleware?

The best way to handle errors across API handlers and middleware is by applying boundary-level handling, transforming infrastructure errors into unified domain errors, and returning consistent, meaningful responses at presentation boundaries.

How do I isolate error sources to improve debuggability in JavaScript?

Isolate error sources in JavaScript by using granular try-catch blocks within your business logic, ensuring proper cleanup operations execute, and defining domain-specific errors to clarify exactly where and why a failure occurred.

Why should I transform infrastructure errors into domain-specific errors?

Transform infrastructure errors into domain-specific errors to maintain a unified error vocabulary across layers, preventing low-level implementation details from leaking into your API handlers while ensuring reliable, debuggable error flows.

Does structured error handling require custom error types in TypeScript?

Yes, structured error handling in TypeScript requires custom error types to differentiate domain failures from infrastructure issues, enabling catch blocks to accurately identify error sources and execute appropriate recovery or cleanup paths.