Global Error Handling

Implement standardized error handling with try-catch blocks, custom exceptions, and retry logic.

Updated Aug 11, 2023
One-click install
npx skills add https://github.com/EIS-ITS/vss-cli --skill global-error-handling-eis-its
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Global Error Handling
Source: https://github.com/EIS-ITS/vss-cli/tree/main/.claude/skills/global-error-handling
Command: npx skills add https://github.com/EIS-ITS/vss-cli --skill global-error-handling-eis-its

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents application crashes, data loss, and user frustration caused by poor error handling. It ensures robust, user-friendly error management, maintaining system stability and providing clear, actionable feedback to users, even during unexpected failures.

Core Features & Use Cases

  • User-Friendly Messages: Provide clear, specific, and actionable feedback to end-users.
  • Specific Exception Types: Use precise exception types for better debugging and targeted recovery.
  • Resource Cleanup: Ensure proper release of resources (e.g., file handles, database connections) in all scenarios.
  • Use Case: When an external payment gateway API call fails, use this skill to implement a retry mechanism with a fallback, and if it still fails, display a user-friendly message instead of a generic server error, guiding the user on next steps.

Quick Start

Implement robust error handling for the attached API endpoint, ensuring all potential failures return clear, specific error messages to the client.

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 application crashes from unhandled exceptions?

Error handling prevents crashes by catching exceptions, validating inputs, and executing cleanup logic. Implement try-catch blocks around risky operations, use specific exception types for targeted recovery, and ensure resources like file handles and database connections are released in all scenarios, even when failures occur.

What's the best way to show users clear error messages instead of generic server errors?

User-friendly error messages require mapping technical failures to specific, actionable feedback. Catch exceptions at API boundaries, translate them into domain-specific messages that guide users on next steps, and avoid exposing internal system details or stack traces to end-users.

How do I implement retry logic when external API calls fail?

Retry logic handles transient failures by catching API errors, attempting the request again with backoff delays, and providing fallback behavior when retries exhaust. Pair this with user-friendly messaging so clients understand what failed and what happens next.

Why does resource cleanup matter in error handling?

Resource cleanup prevents leaks of file handles, database connections, and memory. Use finally blocks or cleanup handlers to guarantee resource release even when exceptions occur, maintaining system stability under repeated failure scenarios.

Can I use validation and error handling across different programming languages?

Error handling patterns—try-catch blocks, custom exceptions, input validation, and resource cleanup—apply across languages. This Skill targets standardized approaches that work in your language ecosystem while maintaining consistent principles for fail-fast validation and graceful degradation.

What happens when error handling isn't centralized in my system?

Inconsistent error handling across endpoints leads to unpredictable user feedback, missed resource cleanup, and difficult debugging. Centralized error boundaries standardize responses, ensure consistent logging, and guarantee proper cleanup, making systems more resilient and maintainable.