Global Error Handling

Implement global error handling across code layers with centralized messaging and logging.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/elliotsaha/smt-slack-app --skill global-error-handling-elliotsaha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Global Error Handling
Source: https://github.com/elliotsaha/smt-slack-app/tree/main/.claude/skills/global-error-handling
Command: npx skills add https://github.com/elliotsaha/smt-slack-app --skill global-error-handling-elliotsaha

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures that your applications handle errors robustly, providing clear, user-friendly messages instead of technical jargon or crashes. It automates the implementation of fail-fast validation and graceful degradation, saving development time and improving user experience.

Core Features & Use Cases

  • Robust Error Management: Implement comprehensive try-catch blocks and error middleware across your codebase.
  • User-Friendly Feedback: Generate clear, non-technical error messages for end-users.
  • Fail-Fast Validation: Automatically apply validation checks to prevent invalid data processing early.
  • Use Case: When a critical external service is temporarily unavailable, this Skill guides the AI to implement a graceful degradation pattern, informing the user of the issue without crashing the application, and logging detailed errors for developers.

Quick Start

When writing the processPayment function, ensure all potential API errors from the payment gateway are caught and return a user-friendly "Payment failed, please try again" message instead of a technical error code.

Frequently Asked Questions about Global Error Handling

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

FAQPage Schema
How do I handle errors gracefully across my entire application?

Global error handling implements try-catch blocks, middleware, and error boundaries across all code layers—input validation, API controllers, and external service calls—to catch unhandled errors early, log them safely, and return user-friendly messages instead of technical details or crashes.

What's the best way to validate user input and prevent invalid data from processing?

Fail-fast validation checks input at entry points before processing, catching errors immediately through structured validation blocks. This prevents invalid data from propagating through your application, reducing downstream failures and improving resilience.

How should I handle external service failures without crashing my application?

Graceful degradation implements retry logic, fallback responses, and resource cleanup when external APIs are unavailable. Users receive clear status messages while the application continues operating with reduced functionality, and developers log detailed errors for investigation.

Why is centralized error handling important for code quality?

Centralized handling ensures consistent error detection and messaging across your codebase, prevents sensitive details from leaking to users, enables safe logging for debugging, and supports idempotent cleanup—reducing bugs and improving maintainability without duplicating error logic everywhere.

Can I use error handling for both synchronous and asynchronous code?

Yes, global error handling applies across all code layers and scenarios including synchronous try-catch blocks, async middleware, error boundaries in UI frameworks, and API/controller boundaries—providing consistent error management regardless of execution model.