Global Error Handling

Implements error handling for APIs, React Boundaries, Sentry monitoring, and retry logic.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/SpacePlushy/portfolio --skill global-error-handling-spaceplushy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Global Error Handling
Source: https://github.com/SpacePlushy/portfolio/tree/main/.claude/skills/global-error-handling
Command: npx skills add https://github.com/SpacePlushy/portfolio --skill global-error-handling-spaceplushy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Inconsistent error handling leads to brittle applications, poor user experience, and difficult debugging. This skill ensures your AI-generated code adheres to best practices for error management, making your applications more reliable and easier to maintain, so you can rest assured your app is resilient.

Core Features & Use Cases

  • Comprehensive Error Strategies: Guides AI to implement try-catch, API error responses, and custom error pages.
  • Contextual Application: Directs AI on handling data fetching errors, API route errors, validation failures, and React Error Boundaries.
  • Production Monitoring: Ensures AI considers integration with tools like Sentry for robust production error tracking.

Quick Start

Implement global error handling for the new user registration API endpoint, ensuring proper HTTP status codes and 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 routes with proper HTTP status codes?

Error handling for API routes involves wrapping endpoint logic in try-catch blocks, catching specific exceptions, and returning appropriate HTTP status codes (400 for validation errors, 500 for server errors). The Skill guides AI to log errors with context and ensure consistent responses across all routes.

What's the best way to handle data fetching errors in React applications?

Handle data fetching errors by wrapping fetch or Content Collection calls in try-catch, implementing React Error Boundaries for component-level failures, and displaying graceful fallbacks to users. The Skill ensures structured error logging and retry logic with exponential backoff for transient failures.

How do I set up production error monitoring with Sentry?

Production error monitoring with Sentry captures unhandled exceptions, logs structured error context, and tracks error trends across your application. The Skill directs AI to integrate Sentry, configure error capture for both server and client environments, and link errors to user sessions for easier debugging.

Why does my application fail silently when API responses have errors?

Silent failures occur when error responses aren't validated or logged. Robust error handling validates API response status codes, implements explicit error cases in client-side scripts, uses try-catch patterns consistently, and logs errors with sufficient context for troubleshooting and monitoring.

Can I use error handling validation at build time?

Yes. Build-time validations catch error handling gaps before deployment by checking that try-catch patterns are applied to data fetching, API calls, and critical operations. The Skill ensures your codebase enforces consistent error management practices across development and production environments.

What should I do when API requests time out or fail temporarily?

Implement exponential backoff retry logic to automatically retry transient failures with increasing delays between attempts. The Skill guides AI to differentiate retryable errors (timeouts, 429) from permanent ones (401, 404), log retry attempts, and eventually fail gracefully after max retries.