error-handling-review
Overview
A specialist review lens that hunts silent failures: errors that occur
without being surfaced, logged with context, or made actionable. A silent
failure turns a five-minute fix into a multi-hour debugging session, because the
first evidence anyone sees is downstream corruption, not the original fault.
This is a deliberately-invoked deep pass, narrower and more opinionated than a
general review. Reach for it when a change adds or touches error handling.
When To Use
- The diff adds or changes
try/catch, try/except, Result/Either
handling, error callbacks, or promise .catch(...).
- A change introduces fallback logic, default-on-failure values, or retries.
- The user asks to "review the error handling", "check the catch blocks",
"audit fallback behavior", or "find swallowed errors".
Boundaries
- Not general code review. Correctness, performance, and style belong to
local-review. This lens looks only at how failures are handled.
- Not security scanning. SAST and the lethal trifecta are
secure-code.
- Read-only. Produce findings; do not edit source.
- No invented evidence. Every finding cites a real file and line in the diff.
Workflow
- Scope the change. Get the diff (
local-review's collector, git diff, or
the files named). Review only changed and directly-adjacent code.
- Locate every failure-handling site.
catch/except blocks, error
callbacks and event handlers, error-state branches, fallback/default values,
"logged but execution continues" paths, and optional-chaining/null-coalescing
that can skip a failing operation.
- Interrogate each site against the five questions in
references/interrogation-checklist.md: logging quality, user feedback,
catch specificity, fallback justification, and propagation. For a catch
block, list the specific unexpected error types it could hide.
- Sweep for hidden-failure patterns: empty catch blocks, catch-and-continue
with only a log, returning
null/undefined/defaults on error without
logging, optional chaining used to dodge a failing call, fallback chains with
no stated reason, and retries that exhaust without informing anyone.
- Judge against this repository's declared conventions, not a hardcoded
stack. Read the repo's
CLAUDE.md/AGENTS.md for its logging and
error-reporting rules; references/stack-conventions.md gives concrete
shapes for TypeScript (Next.js/Supabase) and Python when the repo is silent.
- Report in the output contract below.
Output Contract
Findings first, ordered by severity. For each finding:
Severity: CRITICAL (silent failure, empty or catch-all block that swallows)
· HIGH (over-broad catch, unjustified fallback, unactionable message) ·
MEDIUM (missing context, could be more specific)
Location: path:line
Issue: what is wrong and why it hides a failure
Hidden errors: the specific unexpected error types this site could suppress
User/operator impact: what a person sees instead of the real fault
Recommended fix: the concrete change (surface, log-with-context, narrow the
catch, or justify the fallback in a comment/spec)
Example: the corrected shape, in the file's language
Close with Residual risks — failure paths you could not evaluate (untouched
callers, external services). State explicitly when the error handling is sound;
a clean pass is a real result.
Verification
- Every finding cites a real
path:line from the diff.
- Every
CRITICAL/HIGH names the concrete unexpected error(s) that get hidden,
not just "this is broad".
- Severity matches the stated impact.
- Residual risks section is present even when there are no findings.
Resources
references/interrogation-checklist.md — the five-question interrogation and
the hidden-failure pattern catalog, with the reasoning behind each.
references/stack-conventions.md — concrete logging/propagation shapes for
TypeScript (Next.js/Supabase) and Python, used only when the repo declares no
convention of its own.
Sibling skills
local-review — general diff review (correctness, security, performance).
Run this lens when that pass flags error handling, or invoke it directly.
secure-code — security scanning; orthogonal.
verify-before-complete — completion gate; run after fixes land.
1---2name: error-handling-review3description: Review changed code for silent failures and inadequate error handling — empty or over-broad catch blocks, errors logged-and-swallowed, unjustified fallbacks, null/optional-chaining that hides failures, and retries that exhaust silently. Use when the user asks to review error handling, check catch/try-except blocks, audit fallback behavior, or hunt for swallowed errors. Not general diff review (local-review) or security scanning (secure-code).4---56# error-handling-review78## Overview910A specialist review lens that hunts **silent failures**: errors that occur11without being surfaced, logged with context, or made actionable. A silent12failure turns a five-minute fix into a multi-hour debugging session, because the13first evidence anyone sees is downstream corruption, not the original fault.1415This is a deliberately-invoked deep pass, narrower and more opinionated than a16general review. Reach for it when a change adds or touches error handling.1718## When To Use1920- The diff adds or changes `try/catch`, `try/except`, `Result`/`Either`21 handling, error callbacks, or promise `.catch(...)`.22- A change introduces fallback logic, default-on-failure values, or retries.23- The user asks to "review the error handling", "check the catch blocks",24 "audit fallback behavior", or "find swallowed errors".2526## Boundaries2728- **Not general code review.** Correctness, performance, and style belong to29 `local-review`. This lens looks only at how failures are handled.30- **Not security scanning.** SAST and the lethal trifecta are `secure-code`.31- **Read-only.** Produce findings; do not edit source.32- **No invented evidence.** Every finding cites a real file and line in the diff.3334## Workflow35361. **Scope the change.** Get the diff (`local-review`'s collector, `git diff`, or37 the files named). Review only changed and directly-adjacent code.382. **Locate every failure-handling site.** `catch`/`except` blocks, error39 callbacks and event handlers, error-state branches, fallback/default values,40 "logged but execution continues" paths, and optional-chaining/null-coalescing41 that can skip a failing operation.423. **Interrogate each site** against the five questions in43 `references/interrogation-checklist.md`: logging quality, user feedback,44 catch specificity, fallback justification, and propagation. For a catch45 block, **list the specific unexpected error types it could hide.**464. **Sweep for hidden-failure patterns**: empty catch blocks, catch-and-continue47 with only a log, returning `null`/`undefined`/defaults on error without48 logging, optional chaining used to dodge a failing call, fallback chains with49 no stated reason, and retries that exhaust without informing anyone.505. **Judge against *this* repository's declared conventions**, not a hardcoded51 stack. Read the repo's `CLAUDE.md`/`AGENTS.md` for its logging and52 error-reporting rules; `references/stack-conventions.md` gives concrete53 shapes for TypeScript (Next.js/Supabase) and Python when the repo is silent.546. **Report** in the output contract below.5556## Output Contract5758Findings first, ordered by severity. For each finding:5960- `Severity`: `CRITICAL` (silent failure, empty or catch-all block that swallows)61 · `HIGH` (over-broad catch, unjustified fallback, unactionable message) ·62 `MEDIUM` (missing context, could be more specific)63- `Location`: `path:line`64- `Issue`: what is wrong and why it hides a failure65- `Hidden errors`: the specific unexpected error types this site could suppress66- `User/operator impact`: what a person sees instead of the real fault67- `Recommended fix`: the concrete change (surface, log-with-context, narrow the68 catch, or justify the fallback in a comment/spec)69- `Example`: the corrected shape, in the file's language7071Close with **Residual risks** — failure paths you could not evaluate (untouched72callers, external services). State explicitly when the error handling is sound;73a clean pass is a real result.7475## Verification7677- Every finding cites a real `path:line` from the diff.78- Every `CRITICAL`/`HIGH` names the concrete unexpected error(s) that get hidden,79 not just "this is broad".80- Severity matches the stated impact.81- Residual risks section is present even when there are no findings.8283## Resources8485- `references/interrogation-checklist.md` — the five-question interrogation and86 the hidden-failure pattern catalog, with the reasoning behind each.87- `references/stack-conventions.md` — concrete logging/propagation shapes for88 TypeScript (Next.js/Supabase) and Python, used only when the repo declares no89 convention of its own.9091## Sibling skills9293- `local-review` — general diff review (correctness, security, performance).94 Run this lens when that pass flags error handling, or invoke it directly.95- `secure-code` — security scanning; orthogonal.96- `verify-before-complete` — completion gate; run after fixes land.