global-error-handling

TorbenMerrald's avatarfrom TorbenMerrald

Implement robust error handling strategies with user-friendly messages and graceful failure patterns. Use this skill when catching and handling exceptions or errors in any code. Use this skill when validating input and checking preconditions early in functions. Use this skill when displaying error messages to users. Use this skill when implementing centralized error handling in API layers or controllers. Use this skill when using specific exception types rather than generic errors. Use this skill when implementing retry logic for transient failures. Use this skill when ensuring proper resource cleanup in error scenarios. Use this skill when designing systems to degrade gracefully when non-critical services fail.

⭐1stars🔀0forks📁View on GitHub🕐Updated Jan 9, 2026

When & Why to Use This Skill

This Claude skill provides a comprehensive framework for implementing robust error handling strategies and graceful failure patterns in software development. It enables developers to build resilient systems by standardizing exception management, input validation, and centralized error reporting, ensuring high software reliability and a superior user experience through clear, non-technical messaging.

Use Cases

  • API Error Management: Implementing centralized error handling in API layers or controllers to provide consistent, standardized, and user-friendly error responses while hiding technical stack traces.
  • Input Validation & Fail-Fast: Validating user input and checking preconditions early in functions to prevent invalid data from propagating through the system and causing complex failures.
  • Resilience Engineering: Designing systems with retry logic and exponential backoff for transient failures, and ensuring graceful degradation when non-critical external services are unavailable.
  • Resource Safety & Cleanup: Ensuring proper resource management (such as closing database connections or file handles) in error scenarios using robust try-catch-finally patterns or equivalent mechanisms.
nameGlobal Error Handling
descriptionImplement robust error handling strategies with user-friendly messages and graceful failure patterns. Use this skill when catching and handling exceptions or errors in any code. Use this skill when validating input and checking preconditions early in functions. Use this skill when displaying error messages to users. Use this skill when implementing centralized error handling in API layers or controllers. Use this skill when using specific exception types rather than generic errors. Use this skill when implementing retry logic for transient failures. Use this skill when ensuring proper resource cleanup in error scenarios. Use this skill when designing systems to degrade gracefully when non-critical services fail.

Global Error Handling

When to use this skill

  • When implementing try-catch blocks or error handling logic
  • When validating input and failing fast with clear error messages
  • When displaying error messages to users without exposing technical details
  • When using specific exception or error types for targeted handling
  • When implementing centralized error handling at API or controller boundaries
  • When designing graceful degradation for non-critical service failures
  • When implementing retry strategies with exponential backoff
  • When ensuring resource cleanup in finally blocks or equivalent mechanisms
  • When handling errors across any language or framework in the project

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle global error handling.

Instructions

For details, refer to the information provided in this file: global error handling