error-handling

Handle runtime errors with ErrorBoundary, console.error, and ky HTTP parsing.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/HUMBLEF0OL/miles-mechanical-web --skill error-handling-humblef0ol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/HUMBLEF0OL/miles-mechanical-web/tree/main/.claude/skills/error-handling
Command: npx skills add https://github.com/HUMBLEF0OL/miles-mechanical-web --skill error-handling-humblef0ol

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sonner, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill aids in the graceful handling and communication of errors in applications, enhancing both system reliability and user experience by managing and displaying errors effectively.

Core Features & Use Cases

  • Error Boundary Usage: Implementing React's ErrorBoundary for error-free application components.

  • API Error Patterns: Implementing consistent patterns for displaying error messages upon API failure.

  • Error Propagation: Ensuring proper error handling and communication through various parts of an application.

  • Use Case: With the 'error-handling' Skill, an app developer can integrate an error boundary that will prevent individual components from crashing and notify the user with clear messages, even in the event of a runtime error.

Quick Start

Add the ErrorBoundary to the top of your main app component using <ErrorBoundary /> and implement an ErrorHandler function to parse API errors from ky and display user-friendly toast messages.

Frequently Asked Questions about error-handling

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

FAQPage Schema
How do I prevent React components from crashing the entire application during runtime errors?

You can prevent application crashes by wrapping your components in React's ErrorBoundary. This catches runtime errors within the boundary, stops total application failure, and allows you to display a fallback user interface instead.

What is the best way to display user-friendly error messages when an API request fails?

The best way to handle API request failures is to parse HTTP responses using a client like ky, extract the error details, and display a user-readable error message via a toast notification library like sonner.

How do I manage error propagation and state when fetching data in React?

You manage error propagation during data fetching by catching HTTP response errors, logging them with console.error, and passing user-readable error messages to the UI to maintain stable application state.

Can I use the sonner toast library to report API errors caught by an error boundary?

Yes, you can integrate the sonner toast library to report errors. When the error boundary or error handler catches a runtime or API error, sonner displays a user-friendly toast notification for immediate feedback.

Does this error handling approach work for parsing HTTP responses with ky?

Yes, this approach works directly with ky by parsing failed HTTP responses, extracting the error context, and converting it into a readable message that prevents crashes and informs the user.

Why do I need an error boundary if my application already handles API error states?

You need an error boundary because API error handling only manages failed data fetching requests. An error boundary catches unexpected runtime errors within your component tree, preventing total UI crashes.