error-handling-patterns

Design custom error classes and React error boundaries for applications.

1|Updated Sep 26, 2025
One-click install
npx skills add https://github.com/pascallammers/mylo-travel-concierge-v2 --skill error-handling-patterns-pascallammers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling-patterns
Source: https://github.com/pascallammers/mylo-travel-concierge-v2/tree/main/.factory/skills/error-handling-patterns
Command: npx skills add https://github.com/pascallammers/mylo-travel-concierge-v2 --skill error-handling-patterns-pascallammers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers create more reliable software by implementing comprehensive strategies to anticipate, manage, and recover from errors gracefully.

Core Features & Use Cases

  • Custom Error Classes: Define specific error types for better error categorization and handling.
  • Error Boundaries (React): Catch JavaScript errors in UI components and display fallback UI.
  • Retry Strategies: Implement mechanisms like exponential backoff and circuit breakers for transient failures.
  • Monitoring & Logging: Integrate with services like Sentry and use structured logging for debugging.
  • Use Case: When an API request fails due to a temporary network issue, this skill's retry logic can automatically attempt the request again after a short delay, preventing user frustration and ensuring service continuity.

Quick Start

Implement custom error classes for API responses using the provided TypeScript examples.

Frequently Asked Questions about error-handling-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement retry logic with exponential backoff for failed API requests?

Retry logic with exponential backoff automatically retransmits failed API requests after progressively increasing delays, ensuring service continuity during transient network failures. This strategy prevents immediate repeated request congestion and user frustration.

What's the best way to handle uncaught JavaScript errors in React components?

React error boundaries catch JavaScript errors anywhere in the child component tree, log those errors, and display a fallback UI. This approach ensures graceful degradation by preventing a single component failure from crashing the entire application interface.

How do I create custom error classes for API error responses in TypeScript?

Custom error classes in TypeScript categorize API error responses by extending the base Error object with specific properties. This structured exception management improves debugging fidelity and allows developers to differentiate between various API failure scenarios programmatically.

Can I use structured logging and Sentry integration to improve debugging in fault-tolerant systems?

Structured logging and Sentry integration capture detailed application state and exception traces during runtime failures. This monitoring combination provides the contextual debugging data required to analyze errors and maintain robust fault-tolerant systems.

What is graceful degradation and how does it improve user-friendly error messaging?

Graceful degradation allows an application to maintain partial functionality when components fail, paired with user-friendly error messaging to explain the situation. This resilience strategy ensures the UI remains accessible instead of displaying a broken interface.

When do I need a circuit breaker pattern for promise rejections?

A circuit breaker pattern is needed for promise rejections when an external service experiences sustained failures, halting request attempts to prevent system overload. This resilience mechanism monitors rejections and trips to protect downstream API resources.