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.
npx agentmods add skills/ericrisco/rsc-harness/error-handlingnpx skills add ericrisco/rsc-harness --skill error-handlinggit clone --depth 1 https://github.com/ericrisco/rsc-harnessWrote 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.
[](https://agentmods.dev/skills/ericrisco/rsc-harness/error-handling)<a href="https://agentmods.dev/skills/ericrisco/rsc-harness/error-handling"><img src="https://agentmods.dev/badge/skills/ericrisco/rsc-harness/error-handling.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00078 | $0.03257 |
| Opus 5 | $0.00039 | $0.01629 |
| Sonnet 5 | $0.00016 | $0.00651 |
| Haiku 4.5 | $0.00008 | $0.00326 |
Grade A, and why
error-handling 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 274 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error handling — classify, contain, surface
You are designing what happens whenever anything in a class breaks, not chasing
one crash (that is debug). Every failure gets classified,
contained, and surfaced — never swallowed. The deliverable, in that order: a typed
error taxonomy, a retry policy with caps and jitter, boundary placement, and a
two-audience message contract — never a pile of try { … } catch {}.
Step 1 — Model failure as a taxonomy
Bucket every failure into one of three kinds. The bucket dictates the reaction; get the bucket wrong and every downstream decision is wrong too.
| Bucket | Examples | Retry? | Tell the user | Tell the operator |
|---|---|---|---|---|
| Domain / expected | insufficient funds, slot taken, validation failed | No | Yes, actionable | info — it is normal |
| Infrastructure / transient | timeout, 503, connection reset, 429 | Yes (capped) | "temporary, retrying" | warn — watch the rate |
| Programmer error / bug | null deref, bad assertion, type error | No | generic "something broke" + id | error — page if frequent |
Result vs throw
Decide per call site, not per codebase:
Result<T, E>for expected domain failures the caller must handle. The type checker forces a branch — the failure cannot be ignored by accident.throwfor exceptional / programmer errors. These should crash up to the nearest boundary, not be threaded through every signature.
In TypeScript, neverthrow (current) is the instrument for the Result path:
import { ok, err, Result } from "neverthrow";
type ChargeError = "insufficient_funds" | "card_declined";
// Expected domain failure → Result. The caller MUST handle both arms.
function charge(cents: number, balance: number): Result<number, ChargeError> {
if (cents > balance) return err("insufficient_funds");
return ok(balance - cents);
}
const r = charge(500, 200);
if (r.isErr()) {
// r.error is the typed union — exhaustive, no `any`.
}
What ships with it
5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- yesterday First seen · 274 lines · 78 tokens per session scan A 1195f482283b
error-handling is a skill published in the GitHub repository ericrisco/rsc-harness (60 stars, last pushed 2d ago), licensed MIT. It adds 78 tokens to every session and 3,257 once invoked, about $0.0004 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.
Other skills, from other repositories
distributed-systems
Distributed systems patterns for locking, resilience, idempotency, and rate limiting. Use when implementing distributed locks, circuit breakers, retry policies, idempotency keys, token bucket rate limiters, or fault tolerance patterns.
error-handling
Error handling patterns. Exception hierarchies, Result types, structured error responses, retry strategies, circuit breakers.
Error Boundary Tester
Validate error boundary implementations in React and other frameworks ensuring graceful degradation, proper fallback UI rendering, and error recovery flows.
backend-resilience-patterns
Use this skill when the user says 'resilience', 'circuit breaker', 'retry', 'bulkhead', 'timeout', 'fallback', 'resilience4j', 'fault tolerance', 'rate limiter', 'backoff', 'retry strategy', 'bulkhead pattern'. This skill applies production fault-tolerance patterns: circuit breaker, retry with backoff, bulkhead…
Error Handling Testing Patterns
Testing error handling paths including exception propagation, error boundaries, retry logic, circuit breakers, and graceful degradation.
error-handling
Implement robust error handling with custom error types, proper propagation, user-friendly messages, and logging. Use when adding error handling to APIs, libraries, or applications.