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 skills add MadAppGang/claude-code --skill error-handlinggit clone --depth 1 https://github.com/MadAppGang/claude-codeWrote 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/madappgang/claude-code/error-handling)<a href="https://agentmods.dev/skills/madappgang/claude-code/error-handling"><img src="https://agentmods.dev/badge/skills/madappgang/claude-code/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/madappgang/claude-code/error-handling"><img src="https://agentmods.dev/badge/skills/madappgang/claude-code/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.00028 | $0.02500 |
| Opus 5.5 | $0.00011 | $0.01000 |
| Sonnet 5.5 | $0.00006 | $0.00500 |
| Haiku 4.5 | $0.00003 | $0.00250 |
Grade A, and why
error-handling scanned grade A with 1 finding 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 3mo 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
const response = await fetch(url, { How it starts
The opening of the file, as written. The whole thing — 468 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error Handling Patterns
Overview
Backend error handling patterns for building robust and debuggable services.
Error Types
Custom Error Classes
// Base application error
class AppError extends Error {
constructor(
message: string,
public code: string,
public statusCode: number = 500,
public isOperational: boolean = true
) {
super(message);
this.name = this.constructor.name;
Error.captureStackTrace(this, this.constructor);
}
}
// Specific error types
class ValidationError extends AppError {
constructor(message: string, public fields?: Record<string, string>) {
super(message, 'VALIDATION_ERROR', 400);
}
}
class NotFoundError extends AppError {
constructor(resource: string, id?: string) {
super(
id ? `${resource} with id ${id} not found` : `${resource} not found`,
'NOT_FOUND',
404
);
}
}
class UnauthorizedError extends AppError {
constructor(message: string = 'Unauthorized') {
super(message, 'UNAUTHORIZED', 401);
}
}
class ForbiddenError extends AppError {
constructor(message: string = 'Forbidden') {
super(message, 'FORBIDDEN', 403);
}
}
class ConflictError extends AppError {
constructor(message: string) {
super(message, 'CONFLICT', 409);
}
}
class RateLimitError extends AppError {
constructor(public retryAfter: number) {
super('Too many requests', 'RATE_LIMIT', 429);
}
}
Error Response Format
Standard Format
interface ErrorResponse {
error: {
code: string;
message: string;
details?: unknown;
stack?: string; // Only in development
};
meta: {
requestId: string;
timestamp: string;
};
}
function formatError(error: AppError, requestId: string): ErrorResponse {
const response: ErrorResponse = {
error: {
code: error.code,
message: error.message,
},
meta: {
requestId,
timestamp: new Date().toISOString(),
},
};
if (error instanceof ValidationError && error.fields) {
response.error.details = error.fields;
}
if (process.env.NODE_ENV === 'development') {
response.error.stack = error.stack;
}
return response;
}
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.
- 3mo ago First seen · 468 lines · 28 tokens per session scan A 2aab410a0f5d
error-handling is a skill published in the GitHub repository MadAppGang/claude-code (291 stars, last pushed 8mo ago), licensed MIT. It adds 28 tokens to every session and 2,500 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
error-handling compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| error-handlingMadAppGang/claude-code | Skill | 291 | 8mo ago | MIT | A | 28 | Claude Code |
| error-handlingasgarovf/locusai | Skill | 23 | 8mo ago | MIT | A | 36 | Claude Code |
| analyze-logsHugoRCD/evlog | Skill | 2.0k | 5d ago | MIT | A | 53 | Claude Code, Codex |
| backend-structured-loggingj4flmao/agent-skills | Skill | 47 | 17d ago | MIT | A | 75 | Claude Code, Codex |
| nestjs-error-handlingFilippoDeSilva/skills | Skill | 2 | 5mo ago | none | A | 32 | Claude Code, Codex |
| data-manager-api-troubleshootinggoogle/skills | Skill | 26k | yesterday | Apache-2.0 | A | 179 | Claude Code, Codex |
| api-integration-architectsickn33/agentic-awesome-skills | Skill | 51k | today | MIT | A | 33 | Claude Code |