Global Error Handling

Implement global error handling with retry logic and user-friendly messages.

Updated Oct 31, 2025
One-click install
npx skills add https://github.com/FlorianRiquelme/statamic-assets --skill global-error-handling-florianriquelme
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Global Error Handling
Source: https://github.com/FlorianRiquelme/statamic-assets/tree/main/.claude/skills/global-error-handling
Command: npx skills add https://github.com/FlorianRiquelme/statamic-assets --skill global-error-handling-florianriquelme

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents application crashes and provides clear, user-friendly feedback instead of cryptic technical errors, significantly improving user experience and system stability.

Core Features & Use Cases

  • User-Friendly Messages: Transforms technical errors into understandable messages for end-users.
  • Robust Recovery: Implements retry logic with exponential backoff, proper resource cleanup, and graceful degradation for non-critical failures.
  • Use Case: When an external API fails, this skill ensures the application doesn't crash, logs the error, and presents a helpful message to the user, potentially with a retry option, without exposing sensitive technical details.

Quick Start

Implement global error handling for API calls, ensuring user-friendly messages and proper logging.

Frequently Asked Questions about Global Error Handling

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

FAQPage Schema
How do I implement error handling for API calls to prevent application crashes?

Error handling for API calls involves wrapping requests in try-catch blocks, logging failures, and returning user-friendly messages instead of technical errors. Implement retry logic with exponential backoff for transient failures, and ensure the application degrades gracefully rather than crashing when external APIs fail.

What's the best way to handle exceptions across a backend system?

Use centralized error handling boundaries with explicit exception types to catch and process errors consistently. This approach prevents cascading failures, enables proper resource cleanup, and ensures secure, user-facing messages that don't expose internal system details or sensitive information.

How do I write error messages that users can actually understand?

Transform technical exceptions into clear, actionable messages by removing internal details and system jargon. Provide context about what failed and next steps the user can take, such as retry options or alternative actions, while keeping sensitive technical information in server logs only.

Why should I implement retry logic with exponential backoff?

Retry logic with exponential backoff handles transient failures in external APIs and services by automatically re-attempting requests with increasing delays. This improves resilience and user experience by recovering from temporary outages without exposing errors to end users.

Can I use error handling with database operations and resource cleanup?

Yes. Error handling applies to database operations by catching exceptions, ensuring proper resource cleanup through try-finally blocks or cleanup handlers, and implementing failure-fast behavior to prevent resource leaks and data corruption.

What's the difference between logging errors internally and showing messages to users?

Internal logging captures full technical details for debugging and monitoring, while user-facing messages communicate only necessary information in plain language. This separation prevents information disclosure vulnerabilities and improves user experience by avoiding cryptic error codes.