error-handling-patterns

error-handling-patterns is a skill for Claude Code, Codex from event4u-app/agent-config. It costs 43 tokens per session (1,723 once invoked), scanned A, original, MIT.

A decision guide for choosing how software should report and recover from failures, such as invalid input, timeouts, or unavailable services.

In plain words
What is it for?
It helps choose between exceptions and result values, and between retries, circuit breakers, graceful degradation, and fail-fast behaviour.
Why use it?
It helps prevent inconsistent error handling and clarifies when to fail, retry, fall back, or return a typed result.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps choose between exceptions and result values, and between retries, circuit breakers, graceful degradation, and fail-fast behaviour.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/event4u-app/agent-config/error-handling-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add event4u-app/agent-config --skill error-handling-patterns
Clone the repo
git clone --depth 1 https://github.com/event4u-app/agent-config

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for error-handling-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/event4u-app/agent-config/error-handling-patterns.svg)](https://agentmods.dev/skills/event4u-app/agent-config/error-handling-patterns)
Your own site
<a href="https://agentmods.dev/skills/event4u-app/agent-config/error-handling-patterns"><img src="https://agentmods.dev/badge/skills/event4u-app/agent-config/error-handling-patterns.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for error-handling-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/event4u-app/agent-config/error-handling-patterns"><img src="https://agentmods.dev/badge/skills/event4u-app/agent-config/error-handling-patterns.svg?style=web" alt="Reviewed on agentmods" width="80" height="15"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,723 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.01723
Opus 5 $0.00022 $0.00861
Sonnet 5 $0.00009 $0.00345
Haiku 4.5 $0.00004 $0.00172

Measured 5d ago against content hash 17445dc72722, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

error-handling-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/skills/error-handling-patterns/SKILL.md · 140 lines

How it starts

The opening of the file, as written. The whole thing — 140 lines — stays where its author put it; the contents beside it link to each section on GitHub.

error-handling-patterns

Decision framework for picking an error-handling strategy. Catalogues of language-specific code live upstream (links in § Provenance) — this skill is the predicate, not the pattern library. Sunset-policy compliant: large language-specific catalogues stay in authoritative upstream docs.

When to use

  • Designing how a new feature, API, or service reports failure.
  • Reviewing a diff that introduces a new exception class, Result<T, E>, or sentinel return.
  • Debugging production noise that traces back to inconsistent error semantics.
  • Choosing between retry, circuit-breaker, fallback, and fail-fast for an external dependency.

Do NOT use when:

  • You only need the syntax for a try/catch in language X — read the upstream language guide directly.
  • The failure is a single-call Laravel validation error — route to laravel-validation.
  • The fix is a one-line null check in existing code — route to bug-analyzer.

Decision framework

Step 1 — Classify the failure

Failure is:
  caller's fault (bad input, missing auth)         → reject at boundary, structured error
  expected operational (timeout, 404, rate-limit)  → Result-type / typed return; retry-aware
  unexpected operational (DB down, OOM, deadlock)  → exception; observability + alert
  programmer bug (null deref, off-by-one)          → crash early; do not catch

Step 2 — Pick the reporting mechanism

IF failure is an EXPECTED, branchable outcome the caller will route on
  → Result type / tagged union / typed error return.
  Forces the caller to handle it; the type system is the proof.

IF failure is UNEXPECTED and most callers cannot do anything useful
  → exception, propagated to a single boundary handler.
  One layer (HTTP, queue, CLI) translates exceptions to user-facing errors.

IF failure is UNRECOVERABLE (invariant violated, data corruption)
  → fail loud, fail fast. No catch-and-continue.
  Log structured context, exit / panic / 500.

IF the language idiom forces one choice (Go: errors are values; Rust: Result;
   Python/PHP/JS: exceptions)
  → follow the idiom. Inventing a foreign mechanism is more cost than the
    correctness it buys.

Read the full file on GitHub · 140 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 140 lines · 43 tokens per session scan A 17445dc72722

Subscribe to this mod's changes

error-handling-patterns is a skill published in the GitHub repository event4u-app/agent-config (10 stars, last pushed today), licensed MIT. It adds 43 tokens to every session and 1,723 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

error-handling-patterns

Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.

wshobson/agents · 43 tokens

diagnose-backend-bug

Diagnose a bounded backend or multi-service failure from GitHub Issues, Jira, Aone, user-provided exports, logs, traces, responses, stack traces, or job records. Use when a service, API, RPC, worker, queue, CLI, or scheduled job bug needs correlation through the project's existing observability route before repair; do…

QoderAI/better-harness · 87 tokens

kafka-consumer-lag

Analyse Kafka consumer group lag using the Lenses MCP server. Diagnoses lag causes (throughput bottlenecks, rebalancing, partition skew, stalled consumers) and suggests remediation. Use when user says "check consumer lag", "why are consumers slow", "lag report" or asks about consumer group health or offset progress.…

lensesio/agentic-engineering-for-apache-kafka · 84 tokens

troubleshooting

Systematic backend debugging — reproduce, isolate root cause, implement fix with regression test.

sawrus/agent-guides · 21 tokens

awesome-performance-audit

Read-only audit of performance and reliability — event-loop discipline, streaming and backpressure, memory and CPU diagnostics, shutdown/timeout/job habits, resilience topology (circuit breakers, retry budgets, queue bounds), and frontend delivery (Core Web Vitals, bundle size, hydration) — with evidence per finding…

khasky/awesome-agent-skills · 147 tokens

debug-fe-be-integration

Diagnose and fix frontend↔backend contract failures by tracing client requests, server logs, validation, auth, and responses on both sides. Use for API 4xx/5xx, mismatched payloads, validation failures, or "frontend and backend disagree". Single-layer errors → debug-error.

kensaurus/cursor-kenji · 66 tokens