Review error handling
Reviews failure paths for swallowed errors, lost context, unsafe retries, missing timeouts and internal details leaking to users, with ranked fixes. Use on code that calls I/O or external services.
Error-handling defects stay invisible until production: an empty catch turns an outage into silent data loss, a retry loop around a non-idempotent call charges a customer twice, a missing timeout lets one slow dependency exhaust every worker, and a raw exception message shows a SQL query to an end user. General code review tends to skim these paths because the happy path is where the change is. This review reads only the failure paths, and reports each finding with the concrete failure it causes.
Review the error handling in: Only if [LANGUAGE] is given: Language and framework:
For every call that can fail (I/O, network, database, parsing, external services, user input), follow what happens on failure and check:
- Swallowed errors: empty catch or except blocks, ignored return values or error results, promises without a rejection handler,
catchthat logs and continues where the caller needs to know, fallbacks that hide failure (returning an empty list on error). - Overly broad handling: catching the base exception type or all errors where a specific one was meant, catching programming errors (null dereference, type errors) along with expected ones.
- Lost context: rethrowing without the cause, replacing an error with a vaguer one, messages without the identifiers needed to debug (which order, which file), logging an error and also rethrowing it so it is logged twice.
- Leaks to users: stack traces, SQL, file paths, hostnames or internal error text in responses or UI; inconsistent error formats or status codes for the same failure.
- Unsafe retries: retrying non-idempotent operations without an idempotency key, no cap, no exponential backoff with jitter, retrying errors that are not transient (4xx, validation), retries nested at several layers.
- Timeouts and cancellation: outbound calls without timeouts, timeouts longer than the caller's, cancellation not propagated.
- Cleanup and consistency: resources not released on the error path (files, connections, locks), partial writes left behind, a multi-step operation that fails halfway with no rollback or compensation.
- Crash versus continue: continuing after a failure that leaves the process in an invalid state, or crashing on a recoverable, expected error.
Rank findings by impact: data loss or corruption, then money or security, then outage, then debuggability.
- Each finding needs a location and a concrete failure scenario. If you cannot describe the input or condition that triggers it, drop it.
- Report at most 12 findings. Do not comment on style, naming or the happy path.
- Fixes must follow the language's idioms (wrapping with a cause,
errors.Is/%win Go,raise … fromin Python,Resultin Rust,causein JavaScript) and the project's existing error types if visible. - Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
- If the information you need is not available, say what is missing and how to get it instead of inventing it.
Summary
One or two sentences: overall state and the most serious risk.
Findings
Numbered, most severe first. Each: location — category from the list above — what happens on failure (the scenario) — impact.
Fixes
For the top findings, a short code snippet of the corrected handling.
What is done well
Bullets, or "Nothing notable".
1 required value still a placeholder; the assistant will ask for it.
details
- kind
- Prompt: a task you run by name to get one finished thing back
- domain
- Software engineering
- category
- Code review
- level
- Intermediate
- made for
- Software engineer, Backend engineer, Tech lead / staff engineer
- needs
- repo-read
- risk
- read-only
- version
- v1.0.0 · incubating
- reviewed
- 2026-10-02
- works in
- Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md
use in
npx @hermes-hq/hodios install review-error-handling --target claude-codenpx skills add hermes-hq/hodios-dist --skill review-error-handling -a claude-codeclaude plugin marketplace add hermes-hq/hodios-distclaude plugin install hodios-software-engineering@hodiosThe plugin brings every entry in this domain at once.
pairs well with
All of Code reviewBackend engineer
Acts as a backend engineer focused on correct data handling, clear API contracts, explicit failure modes and services that are easy to operate. Use as a builder or reviewer persona for server code.
backend-engineerCode reviewer
Reviews changes like a senior engineer who blocks only on real defects, backs every finding with a triggering input, and keeps style opinions out. Use as a reviewer persona or subagent.
code-reviewerReview a pull request
Reviews a pull request diff for correctness bugs, risky changes and missing tests, and returns ranked findings. Use before merging a PR, branch or diff.
review-pull-requestGrade my review comments
Grades the review comments a developer wrote on a real diff, showing which caught real defects, which were overstated nits, what was missed and how to phrase each better. Use to learn to review.
grade-my-review-commentsHunt planted bugs in a practice pull request
Presents a realistic practice pull request with planted defects such as an off-by-one, a race or a security hole, then scores the learner's review comments against them.
play-code-review-bug-huntReply to a first-time contribution
Reviews a first-time contributor's pull request and drafts the reply that gets it merged or redirected without losing the person, with blocking items separated from optional ones. Use on any first PR.
reply-to-first-contribution