global-error-handling_skill

This skill guides you to implement robust error handling across code, API boundaries, and user-facing messages with fail-fast and graceful degradation.
  • TypeScript

0

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill tlabs-xyz/tbtc-v2-performance --skill global-error-handling

  • SKILL.md2.1 KB

Overview

This skill teaches how to implement robust, centralized error handling across services and codebases. It focuses on user-friendly messages, specific exception types, fail-fast validation, centralized boundaries, and graceful degradation to keep systems reliable and secure. Use it to standardize try/catch patterns, custom errors, and recovery strategies across languages and frameworks.

How this skill works

The skill inspects places where errors can originate (input validation, external calls, resource management) and recommends concrete patterns: fail-fast checks, meaningful custom error classes, centralized handlers or middleware, and finally/finalizers for cleanup. It favors clear, actionable messages for users while preventing leakage of technical or sensitive details. It also prescribes retry strategies (with exponential backoff) and escalation when failures persist.

When to use it

  • Adding try/catch blocks or rethrowing exceptions
  • Creating custom error classes or domain-specific error types
  • Implementing centralized error middleware, boundaries, or API handlers
  • Validating inputs and performing precondition checks (fail-fast)
  • Handling external service, database, or third-party failures
  • Designing graceful degradation and retry logic (exponential backoff)

Best practices

  • Fail fast: validate inputs and preconditions before doing work
  • Use specific error types so handlers can respond appropriately
  • Centralize top-level error handling at API or controller boundaries
  • Return clear, actionable user-facing messages; hide technical internals
  • Clean up resources in finally blocks or equivalent deterministic teardown
  • Apply retries with exponential backoff and circuit breaking for unstable external calls

Example use cases

  • Wrap controller endpoints with a centralized error middleware that maps exceptions to HTTP responses
  • Define domain errors (e.g., ValidationError, NotFoundError) and switch on type to set status codes
  • Validate incoming payloads immediately and throw a ValidationError to avoid wasted work
  • Implement retry logic for transient network calls with exponential backoff and a max retry limit
  • Use an error boundary in UI frameworks to show a friendly fallback UI while logging diagnostics

FAQ

Log detailed diagnostics (stack traces, timestamps, correlated IDs) to secure systems, but return only concise, non-sensitive messages to users.

When should I retry a failed external call?

Retry for transient errors (network timeouts, rate limits) with exponential backoff and jitter; avoid retrying for permanent failures (authentication, bad requests).

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
global-error-handling skill by tlabs-xyz/tbtc-v2-performance | VeilStrat