Global Error Handling

Implement try-catch blocks, error boundaries, and retries with exponential backoff across frontend and backend.

6|1|Updated Nov 12, 2022
One-click install
npx skills add https://github.com/coreyja/coreyja.com --skill global-error-handling-coreyja
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Global Error Handling
Source: https://github.com/coreyja/coreyja.com/tree/main/.claude/skills/global-error-handling
Command: npx skills add https://github.com/coreyja/coreyja.com --skill global-error-handling-coreyja

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents application crashes and provides a consistent, user-friendly experience by guiding robust error management across all parts of the system, from frontend to backend.

Core Features & Use Cases

  • Robust Exception Management: Implements try-catch blocks, error boundaries, and specific exception types for comprehensive error capture.
  • User-Friendly Feedback: Ensures error messages are clear, informative, and don't expose sensitive technical details to end-users.
  • Use Case: When developing an API endpoint, use this skill to ensure all potential errors (e.g., invalid input, database failure, external service timeout) are caught and return appropriate HTTP status codes and user-friendly messages.

Quick Start

Apply the Global Error Handling skill to refactor the user registration endpoint, ensuring all validation and database errors are caught and return clear, non-technical messages to the user.

Frequently Asked Questions about Global Error Handling

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

FAQPage Schema
How do I prevent my application from crashing when errors occur?

Global error handling catches exceptions across frontend and backend using try-catch blocks and error boundaries, preventing crashes. Implement centralized error management at all layers—API calls, UI event handlers, and background tasks—to ensure your application recovers gracefully instead of failing.

What's the best way to show users friendly error messages without exposing technical details?

Global error handling separates user-facing messages from internal technical details by catching exceptions and mapping them to clear, non-revealing feedback. Return appropriate HTTP status codes and descriptive messages that help users understand what went wrong without leaking sensitive system information.

How do I handle retries and timeouts in API calls and external services?

Implement exponential backoff retry logic within your error handling strategy to manage transient failures from external services and API timeouts. Catch timeout exceptions and database failures separately, allowing your application to retry failed operations before returning an error to the user.

Can I apply error handling consistently across both frontend and backend?

Yes, global error handling applies to all application layers—frontend UI event handling, backend API endpoints, and background tasks. Use specific exception types and centralized error boundaries to enforce consistent error management strategies across your entire system.

What happens when non-critical features fail in my application?

Graceful degradation in global error handling allows non-critical failures to degrade functionality without crashing the app. Catch exceptions in secondary features and log them securely while letting core functionality continue, maintaining user experience even when some features are unavailable.