exception-handling

Automates retry logic, fallback pathways, and structured error repair for agentic systems.

1|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/LauraFlorentin/skills-marketplace --skill exception-handling-lauraflorentin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exception-handling
Source: https://github.com/LauraFlorentin/skills-marketplace/tree/main/agentic-skills/skills/exception-handling
Command: npx skills add https://github.com/LauraFlorentin/skills-marketplace --skill exception-handling-lauraflorentin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Patterns for ensuring system resilience by detecting failures (API errors, hallucinations, validation errors) and executing predefined fallback logic. Use when user asks to "handle agent errors", "add error recovery", "make my agent fault-tolerant", or mentions exception handling, graceful degradation, or retry logic.

Core Features & Use Cases

Exception Handling ensures that an agentic system degrades gracefully rather than crashing. In the nondeterministic world of LLMs, failures are common: models hallucinate, APIs time out, and outputs are malformed. This pattern wraps critical operations in "try/catch" blocks that trigger recovery agents or fallback strategies.

Use Cases

  • API Fallback: Primary model API failed? Switch to backup model API.
  • Refusal Handling: If the model refuses to answer (due to safety filters), catch the refusal and rephrase or explain why it can't answer.
  • Validation Repair: If JSON validation fails, pass the error back to the model to fix the syntax.

Quick Start

Wrap critical operations in try/catch blocks and implement predefined fallback strategies for API errors, timeouts, and validation issues.

Frequently Asked Questions about exception-handling

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

FAQPage Schema
How do I add error recovery to my LLM agent when API calls fail?

Exception handling for LLM agents involves wrapping critical operations in try/catch blocks that trigger fallback strategies, such as switching to backup model APIs or executing retry logic with backoff to maintain uptime.

What is graceful degradation in agentic systems?

Graceful degradation in agentic systems means degrading safely rather than crashing when failures occur. It detects API errors, model refusals, or validation issues and executes predefined fallback pathways to maintain operational safety.

How do I handle model refusals and malformed JSON validation errors in production agents?

To handle model refusals and JSON validation errors in production agents, catch refusals to rephrase prompts or explain limitations, and pass validation errors back to the model to automatically repair malformed JSON syntax.

What is the best way to make an autonomous workflow fault-tolerant against timeouts?

The best way to make autonomous workflows fault-tolerant is to implement retry logic with backoff and structured error repair, catching timeouts and routing execution to predefined fallback pathways to ensure continuous operation.

Can I use this exception handling pattern for data validation errors across different workflows?

Yes, you can apply this exception handling pattern to data validation errors across production agents and workflows. It catches validation failures and executes structured error repair to maintain safe operational states.