error-handling

Implement typed error hierarchies and structured handlers across TypeScript, Python, and Go.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill error-handling-sakamoto-family-smile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/sakamoto-family-smile/agent_monorepo/tree/main/.claude/skills/ecc/error-handling
Command: npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill error-handling-sakamoto-family-smile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Patterns for robust error handling across TypeScript, Python, and Go. It promotes typed errors, explicit error contracts, and safe user-facing messages to reduce debugging time and incidents.

Core Features & Use Cases

  • Typed error classes: define a hierarchy (AppError and specific errors) to carry codes and status.
  • Result-style error handling: return { ok, value } or { ok, error } to avoid exceptions in hot paths.
  • Global exception and boundary patterns: central handlers for Next.js/Express, FastAPI, and Go HTTP layers; consistent JSON error responses.
  • Retry / backoff & resilience: exponential backoff strategies and retry guards for transient failures.
  • User-facing messaging: map error codes to friendly messages while logging full context server-side.
  • Quality checks: implement error-handling checklist ensuring no silent catches and proper propagation.

Quick Start

Define a base AppError class and create specific error subclasses; wire a global error handler to return structured error responses in APIs.

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 patterns in TypeScript, Python, and Go?

Implement structured error handling by defining a base typed error class with specific subclasses carrying error codes and status. This creates explicit error contracts and consistent JSON responses across TypeScript, Python, and Go services.

What is the best way to handle transient failures with retry and backoff strategies?

Handle transient failures using exponential backoff strategies and retry guards. This resilience pattern safely retries failed network requests or service calls without overwhelming the system during temporary outages.

How do I set up global exception boundaries for FastAPI, Next.js, and Go HTTP servers?

Set up global exception boundaries by wiring central error handlers in your FastAPI, Next.js, or Go HTTP layers. These boundaries catch unhandled exceptions and return consistent JSON error responses to the client.

How do I map internal error codes to safe user-facing messages while preserving server logs?

Map internal error codes to safe user-facing messages through a centralized error handler. This handler returns friendly messages to users while simultaneously logging full error context and stack traces server-side for developers.

Can I use result-style error handling to avoid exceptions in hot application paths?

Yes, you can use result-style error handling by returning { ok, value } or { ok, error } objects. This pattern avoids throwing exceptions in critical hot paths, ensuring predictable execution flow in TypeScript and Python.

What is a circuit breaker pattern and when should I use it in production apps?

A circuit breaker pattern stops sending requests to a failing downstream service, preventing cascading failures. Use it in production apps to maintain system resilience when dependencies experience sustained outages.