global-error-handling

maksimtereshin's avatarfrom maksimtereshin

Implement robust error handling with user-friendly messages, specific exception types (ISP), centralized error boundaries (SRP), fail-fast validation (KISS), graceful degradation, retry strategies, and proper resource cleanup. Use this skill when adding try-catch blocks, throwing or catching exceptions, creating error classes, implementing error boundaries or middleware, displaying error messages to users, or handling async errors and promise rejections. Use when working with error handling in any language (.ts, .js, .py, .java, .go) across backend services, API endpoints, frontend components, or data processing pipelines. Use when implementing exponential backoff for external service calls or ensuring resources are cleaned up in finally blocks.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 10, 2026⬇️1downloads

When & Why to Use This Skill

The Global Error Handling skill empowers Claude to implement production-grade error management strategies across full-stack applications. By leveraging industry-standard principles like SRP, ISP, and KISS, it ensures the creation of resilient, maintainable, and user-friendly software. This skill is essential for developers looking to automate the implementation of centralized error boundaries, custom exception hierarchies, and robust retry logic in languages such as TypeScript, Python, Java, and Go.

Use Cases

  • Case 1: Designing centralized error-handling middleware for backend APIs to ensure consistent error responses and proper HTTP status code mapping.
  • Case 2: Implementing React or Vue error boundaries to catch frontend runtime errors, preventing total UI crashes and providing graceful fallback components.
  • Case 3: Developing custom exception classes and hierarchies that follow the Interface Segregation Principle for more granular and meaningful error catching.
  • Case 4: Configuring resilient integration patterns, such as exponential backoff and retry strategies, for unstable third-party service calls.
  • Case 5: Refactoring legacy code to include fail-fast validation and proper resource cleanup in finally blocks to prevent memory leaks and data corruption.
nameGlobal Error Handling
descriptionImplement robust error handling with user-friendly messages, specific exception types (ISP), centralized error boundaries (SRP), fail-fast validation (KISS), graceful degradation, retry strategies, and proper resource cleanup. Use this skill when adding try-catch blocks, throwing or catching exceptions, creating error classes, implementing error boundaries or middleware, displaying error messages to users, or handling async errors and promise rejections. Use when working with error handling in any language (.ts, .js, .py, .java, .go) across backend services, API endpoints, frontend components, or data processing pipelines. Use when implementing exponential backoff for external service calls or ensuring resources are cleaned up in finally blocks.

Global Error Handling

This Skill provides Claude Code with specific guidance on error handling best practices across backend and frontend code, including KISS, ISP, and SRP principles.

When to use this skill

  • When adding try-catch blocks or error handling logic to any code
  • When throwing or catching exceptions/errors in any programming language
  • When creating custom exception or error classes
  • When implementing centralized error handling (middleware, error boundaries, global handlers)
  • When displaying error messages to users in UI components
  • When handling async errors and promise rejections
  • When implementing retry strategies with exponential backoff
  • When ensuring graceful degradation when non-critical services fail
  • When validating input and failing fast with clear error messages (KISS)
  • When using specific exception types instead of generic errors (ISP)
  • When cleaning up resources in finally blocks or equivalent mechanisms
  • When working with error handling in backend (.ts, .py, .java, .go) or frontend (.tsx, .jsx, .vue)
  • When implementing error logging and monitoring

Instructions

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