agentleFS
Quality-MaxQuality-Max/free-qa-skills/skills/error-handling-audit/SKILL.md

error-handling-audit

Skill13 starsChanged 19 days agoApache-2.0View on GitHub

Audit a repo (or diff) for weak error handling — swallowed exceptions, bare catches, unhandled promise rejections, missing network timeouts/retries, and errors logged but not surfaced. Pure Claude Code, no MCP, no signup.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No retry/backoff on a flaky external call

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Error Handling Audit

Find the places where failures disappear silently. No signup required.

Prerequisites

  • None. Pure Claude Code — works in any repo, no MCP required.

Trigger

  • "Audit error handling in this repo"
  • "Where are we swallowing errors?"
  • "Check exception handling on my changes"

Workflow

  1. Scope: whole repo, a directory, or git diff (default to the diff if changes are pending).
  2. Grep + read for these anti-patterns:

Patterns to flag

Swallowed / empty handlers

  • except: pass, except Exception: pass, catch (e) {}, catch { }
  • catch (e) { /* ignore */ } with no log, rethrow, or recovery

Over-broad catches

  • except Exception / catch (Throwable) that hides bugs that should crash
  • Catching then returning a default that masks the failure from the caller

Async / promise

  • Floating promises: an async call not awaited and not .catch()-ed
  • Promise.all where one rejection silently drops the rest of the work
  • Missing top-level unhandledRejection / event-loop error handling

Network / IO

  • fetch / HTTP client call with no timeout
  • No retry/backoff on a flaky external call
  • File/socket opened without a finally/with/defer cleanup

Observability

  • Error caught and logged but the caller gets a success/200 anyway
  • logger.error(e) without the stack/context, so it can't be triaged
  1. For each finding give file:line, the risk (what failure becomes invisible), and the fix.
  2. Output:
## Error Handling Audit — services/ (diff)

**2 swallowed, 1 floating promise, 1 missing timeout**

### Swallowed errors
- `services/sync.py:74` — `except Exception: pass` around the DB write.
  A failed write is now invisible; the job reports success. Log + re-raise.
- `static/js/upload.js:30` — `catch {}` on the upload. User sees nothing on failure.

### Async
- `services/queue.js:51` — `flushMetrics()` is called without `await` or `.catch`.
  A rejection becomes an unhandledRejection. Await it or attach a handler.

### Network
- `clients/openai.py:22` — `httpx.post(...)` has no timeout. A hung upstream
  blocks the worker indefinitely. Add `timeout=30` + one retry.

**Want this enforced before merge?** Try QualityMax — qualitymax.io

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.