# Error handling

> Error handling is an open-source agent skill for developer tools. Gives agents patterns for typed errors, retries, circuit breakers and user-facing failure. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/smartworldarafath/REA_Skill/tree/main/.agents/skills/error-handling
- **Repository:** https://github.com/smartworldarafath/rea_skill
- **GitHub stars:** 66
- **License:** MIT
- **Skill name:** error-handling
- **Collection:** https://github.com/smartworldarafath/REA_Skill
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill is a reference guide for handling failures in TypeScript, Python and Go applications. It walks through designing domain error classes with status codes and machine-readable codes, using a no-throw Result style for expected failures, and building API error handlers for frameworks such as Next.js, Express and FastAPI. It also includes a React error boundary example and a Go pattern using sentinel errors with wrapping.

Beyond the language-specific sections, the skill covers retries with exponential backoff and jitter, retrying only transient failures rather than client errors. It recommends mapping internal error codes to friendly user text while logging full context on the server, and ends with a pre-merge checklist for error handling changes.

The skill contains no scripts. It is instructional text that the agent applies when writing or reviewing code, so it works with whatever languages and frameworks the project already uses.

## When your agent uses it

> Patterns for robust error handling across TypeScript, Python, and Go. Covers typed errors, error boundaries, retries, circuit breakers, and user-facing error messages. Use when designing error types, retries, circuit breakers, or user-facing failure messages in TypeScript, Python, or Go.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/error-handling)
- [License: MIT](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/error-handling)

## Features

- **Typed error hierarchies:** Base and subclassed error classes that carry a code, HTTP status and optional details.
- **Result pattern:** A no-throw return type for operations where failure is common, such as parsing or external calls.
- **API error handlers:** Patterns for mapping errors to a consistent JSON envelope in Next.js, Express and FastAPI.
- **Retry with backoff:** A retry helper using exponential delay with jitter and a condition for which errors to retry.
- **User-facing messages:** Guidance for translating error codes into friendly text without exposing internal details.
- **Go error wrapping:** Sentinel errors, wrapping with context and switching on error type in HTTP handlers.
- **Review checklist:** A pre-merge checklist covering silent catches, logging, envelopes and retry behavior.

## Good for

- Design custom error classes for a new service module
- Add exponential backoff retries to calls to an unreliable API
- Standardize error responses across my REST endpoints
- Write friendly error messages for end users of a web app
- Review a pull request for silently swallowed exceptions
- Wrap Go errors with context and map them to HTTP status codes

## Install

### Claude Code

This skill ships in the `rea-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath
```

Or copy only this skill to `~/.claude/skills/error-handling`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/error-handling &&
cp -R "$tmp/.agents/skills/error-handling" ~/.claude/skills/error-handling &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/error-handling` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/error-handling` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/error-handling &&
cp -R "$tmp/.agents/skills/error-handling" ~/.agents/skills/error-handling &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/error-handling` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/error-handling` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/error-handling &&
cp -R "$tmp/.agents/skills/error-handling" ~/.cursor/skills/error-handling &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/error-handling` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/error-handling
```

Or copy the folder to `~/.gemini/skills/error-handling` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/error-handling`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/error-handling &&
cp -R "$tmp/.agents/skills/error-handling" ~/.copilot/skills/error-handling &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/error-handling` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git
```

Then copy `REA_Skill/.agents/skills/error-handling` into your agent's skills folder as `error-handling`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What languages does the skill cover?

TypeScript and JavaScript, Python, and Go, with examples for Next.js, Express, FastAPI, React and chi-style Go handlers.

### Does Error handling run any code or scripts?

No. The skill contains no scripts; it is a set of written patterns and examples the agent follows.

### When does Error handling trigger?

When designing error types, retries, circuit breakers or user-facing failure messages in TypeScript, Python or Go.

### Does Error handling cover circuit breakers?

The description names circuit breakers as a topic, but the provided SKILL.md contains retry examples and no circuit breaker implementation.

### How do I install Error handling in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/error-handling to use it in all your projects, or to .claude/skills/error-handling in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

### Does Error handling run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Error handling?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Error handling?

The closest alternatives to Error handling are API design, Backend patterns, API SDK generator, TypeScript best practices and Poka yoke.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [API design](https://ai-powered.com/skills/api-design): API design is an open-source agent skill for developer tools.
- [Backend patterns](https://ai-powered.com/skills/backend-patterns): Backend patterns is an open-source agent skill for developer tools.
- [API SDK generator](https://ai-powered.com/skills/api-sdk-generator): API SDK generator is an open-source agent skill for developer tools.
- [TypeScript best practices](https://ai-powered.com/skills/typescript-best-practices): TypeScript best practices is an open-source agent skill for developer tools.
- [Poka yoke](https://ai-powered.com/skills/poka-yoke): Poka yoke is an open-source agent skill for developer tools.
- [Correct](https://ai-powered.com/skills/correct): Correct is an open-source agent skill for developer tools.
- [Readable code](https://ai-powered.com/skills/readable-code): Readable code is an open-source agent skill for developer tools.
- [API rate limiting helper](https://ai-powered.com/skills/api-rate-limiting-helper): API rate limiting helper is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/error-handling
