Error Handling & Resilience

Implement custom error classes, structured logging, error boundaries, and retry logic across full-stack SaaS applications.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/theofernandezz/ai-library --skill error-handling-resilience
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Error Handling & Resilience
Source: https://github.com/theofernandezz/ai-library/tree/main/.opencode/skills/generic/error-handling
Command: npx skills add https://github.com/theofernandezz/ai-library --skill error-handling-resilience

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Production-grade error handling, logging, and recovery patterns for robust SaaS applications.

Core Features & Use Cases

  • Custom error classes, structured logging, error boundaries, retry logic, safe asynchronous wrappers.
  • Use Case: End-to-end error handling coverage that keeps systems observable and users informed during failures.

Quick Start

Define core error classes, implement safe wrappers, and add error boundaries to recover from failures.

Frequently Asked Questions about Error Handling & Resilience

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

FAQPage Schema
How do I implement full-stack error handling for frontend and backend failures?

Robust error handling for SaaS applications utilizes custom error classes, structured logging, and safe asynchronous wrappers to catch failures. This pattern ensures systems remain observable and users stay informed during unexpected frontend or backend crashes.

What is the best way to add retry logic and structured logging to server actions?

The best way to add retry logic and structured logging to server actions is by defining custom error classes and implementing safe asynchronous wrappers. This pattern captures failures systematically and maintains production-grade observability across your backend workflows.

Does this error handling approach work for both UI error boundaries and API routes?

Yes, this approach covers full-stack SaaS applications including UI error boundaries and API routes. It spans frontend and backend environments to provide comprehensive recovery, structured logging, and user-friendly error responses.

How do I build safe asynchronous wrappers for robust error recovery?

Building safe asynchronous wrappers involves encapsulating your API calls and server actions with custom error classes and retry logic. This technique safely catches exceptions, logs errors structurally, and enables graceful recovery without crashing the application.

When do I need custom error classes for resilient application architecture?

You need custom error classes when building production-grade SaaS applications that require structured logging and specific error recovery patterns. They allow you to categorize failures precisely across server actions and API routes to deliver user-friendly error responses.