Borrowing it
Nothing to install: this file belongs to Piyush8296/claude-workspace. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Piyush8296/claude-workspace/main/.claude/skills/error-handling/SKILL.mdgit clone --depth 1 https://github.com/Piyush8296/claude-workspaceWrote 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/piyush8296/claude-workspace/error-handling)<a href="https://agentmods.dev/skills/piyush8296/claude-workspace/error-handling"><img src="https://agentmods.dev/badge/skills/piyush8296/claude-workspace/error-handling/github.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.
<a href="https://agentmods.dev/skills/piyush8296/claude-workspace/error-handling"><img src="https://agentmods.dev/badge/skills/piyush8296/claude-workspace/error-handling.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00065 | $0.01787 |
| Opus 5 | $0.00032 | $0.00894 |
| Sonnet 5 | $0.00013 | $0.00357 |
| Haiku 4.5 | $0.00006 | $0.00179 |
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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 246 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error Handling
The Error Handling Hierarchy
Errors should be caught at the closest meaningful boundary, not at the top of the tree.
App Error Boundary (crash recovery, "something went wrong" page)
└─ Route Error Boundary (per-page, Next.js error.tsx)
└─ Feature Error Boundary (per-feature section)
└─ Component-level try/catch (inline error UI)
└─ Query/Mutation onError (toast notifications)
Custom Error Classes
// lib/errors.ts
export class AppError extends Error {
constructor(
message: string,
public code: string,
public statusCode: number = 500,
public isOperational: boolean = true, // Expected vs unexpected
public context?: Record<string, unknown>,
) {
super(message);
this.name = 'AppError';
}
}
export class ValidationError extends AppError {
constructor(message: string, public fields: Record<string, string[]>) {
super(message, 'VALIDATION_ERROR', 400);
this.name = 'ValidationError';
}
}
export class AuthError extends AppError {
constructor(message = 'Authentication required') {
super(message, 'AUTH_ERROR', 401);
this.name = 'AuthError';
}
}
export class NotFoundError extends AppError {
constructor(resource: string, id: string) {
super(`${resource} not found: ${id}`, 'NOT_FOUND', 404);
this.name = 'NotFoundError';
}
}
Error Normalizer
// lib/errors/normalize.ts
import { AppError } from './errors';
export function normalizeError(error: unknown): AppError {
// Already normalized
if (error instanceof AppError) return error;
// API errors
if (error instanceof Response || (error && typeof error === 'object' && 'status' in error)) {
const e = error as { status: number; statusText?: string };
return new AppError(
e.statusText ?? 'Request failed',
'API_ERROR',
e.status,
);
}
// Network errors
if (error instanceof TypeError && error.message.includes('fetch')) {
return new AppError('Network error — check your connection', 'NETWORK_ERROR', 0);
}
// Abort errors (not real errors)
if (error instanceof DOMException && error.name === 'AbortError') {
return new AppError('Request cancelled', 'ABORT_ERROR', 0, true);
}
// Unknown errors
const message = error instanceof Error ? error.message : 'An unexpected error occurred';
return new AppError(message, 'UNKNOWN_ERROR', 500, false);
}
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.
- 8d ago First seen · 246 lines · 65 tokens per session scan A 33233c352067
error-handling is a skill published in the GitHub repository Piyush8296/claude-workspace (2 stars, last pushed 4mo ago), licensed MIT. It adds 65 tokens to every session and 1,787 once invoked, about $0.0003 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-08-31.
Other skills, from other repositories
generic-react-feature-developer
Guide feature development for React applications with architecture focus. Covers Zustand/Redux patterns, IndexedDB usage, component systems, lazy loading strategies, and seamless integration. Use when adding new features, refactoring existing code, or planning major changes.
generic-react-ux-designer
Professional UI/UX design expertise for React applications. Covers design thinking, user psychology (Hick's/Fitts's/Jakob's Law), visual hierarchy, interaction patterns, accessibility, performance-driven design, and design critique. Use when designing features, improving UX, solving user problems, or conducting design…
generic-react-design-system
Complete design system reference for React applications. Covers colors, typography, spacing, component patterns, glassmorphism effects, GPU-accelerated animations, and WCAG AA accessibility. Use when implementing UI, choosing colors, applying spacing, creating components, or ensuring brand consistency.
generic-react-code-reviewer
Review React/TypeScript code for bugs, security vulnerabilities, performance issues, accessibility gaps, and CLAUDE.md workflow compliance. Enforces TypeScript strict mode, GPU-accelerated animations, WCAG AA accessibility, bundle size limits, and surgical simplicity. Use when completing features, before commits, or…
error-boundary-creator
Create error boundaries, error handling, and fallback UIs for React applications. Use when implementing error handling, creating fallback components, or setting up error reporting.
react-ops
React development patterns, hooks, state management, Server Components, and performance optimization. Use for: react, hooks, useState, useEffect, jsx, tsx, next.js, nextjs, app router, server components, RSC, zustand, react query, component patterns, react testing library, error boundary, suspense, react 19.