error-handling-review
Skill0 starsChanged 10 days agoMITView on GitHub
Review error handling in code - empty catch/except blocks, swallowed exceptions, catch-all without re-throw or logging, ignored return values and error codes, missing input validation at boundaries (user input, files, network), resources that are not closed, lost exception causes and error messages that leak internals. Use when asked to check/review/audit error handling, exception handling, robustness, "what happens when this fails" or failure paths, in any language.
In this repository28 other files it gives its agents.
- accessibility-auditSkill
- api-design-reviewSkill
- architecture-reviewSkill
- complexity-checkSkill
- concurrency-reviewSkill
- config-reviewSkill
- cpp-google-styleSkill
- csharp-google-styleSkill
- dead-code-finderSkill
- dependency-auditSkill
- doc-comment-auditSkill
- full-reviewSkill
- java-google-styleSkill
- logging-reviewSkill
- markdown-readme-google-styleSkill
- naming-reviewSkill
- owasp-security-reviewSkill
- performance-reviewSkill
- privacy-reviewSkill
- python-google-styleSkill
- regex-reviewSkill
- repo-hygieneSkill
- review-without-fixingSkill
- secrets-scanSkill
- shell-google-styleSkill
- sql-reviewSkill
- test-coverage-reviewSkill
- todo-auditSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Check the files/directories the user names, otherwise the whole repo.
- Distinctive: line 55
Every finding has a concrete location and describes the concrete failure scenario ("If the file is missing, the function returns an empty …
- Distinctive: line 58
Do not change code. Apply fixes only when the user explicitly asks for it.
≈ “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.
Files
Error handling review
Review only: report findings, never change code unless the user explicitly asks.
Scope
Check the files/directories the user names, otherwise the whole repo. Focus on production code; tests only for EH1/EH5-style issues that hide test failures. Skip .git/, build output, vendor/, node_modules/, .venv/ and generated code.
Steps
- Grep for the patterns in the language table to find candidates fast, then read each candidate in context.
- Identify the boundaries (HTTP handlers, CLI argument parsing, file/network/database access, deserialization, public library functions) and check EH5/EH7 there specifically.
- Determine the project's error strategy (exceptions, error codes,
Result/Option, error returns in Go) and judge findings against it (EH10). - Report (format below).
Rules
- EH1 error: empty
catch/exceptblock, or onlypass/// ignorewithout a reason - EH2 error: swallowed exception: caught and ignored, only printed to stdout, or turned into
null/false/default value without logging or a documented reason - EH3 warning: catch-all (
catch (Exception),catch (Throwable),except Exception/BaseException,catch (...),catch {}in JS) outside a top-level boundary, without re-throw or logging - EH4 error: ignored return value or error code (C
malloc/fopen/write, Go_ = error uncheckederr, C#TryParseresult unused, uncheckedsubprocessreturn code, Promise withoutawait/.catch, Rustunwrap()/expect()in library code) - EH5 warning: missing validation at a boundary (null/empty, range, format, size limits, path traversal, type of deserialized data)
- EH6 error: resource not released on all paths (no
try-with-resources/using/with/defer/RAII, close only on the happy path, missingfinally) - EH7 warning: error message or response leaks internals (stack traces, SQL, file paths, secrets) to users or HTTP clients
- EH8 warning: lost cause: new exception without the original (
throw new X(msg)withoutcause, Pythonraise Xinsideexceptwithoutfrom e,errors.Newinstead offmt.Errorf("...: %w", err)) - EH9 info: exceptions used for normal control flow
- EH10 info: inconsistent strategy in one module (exceptions mixed with error codes,
nullmixed withOptional/Result) - EH11 info:
tryblock much larger than the statements that can actually fail - EH12 info: log-and-rethrow at every level (the same error is logged many times)
- EH13 error:
return/breakinsidefinally(silently discards the exception) - EH14 warning: retry without limit or backoff, or timeout missing on network calls
Language patterns (starting points for grep)
| Language | Look for |
| Java / Kotlin | catch (.*) { + } on next line, catch (Exception, catch (Throwable, printStackTrace(), new FileInputStream outside try-with-resources |
| C# | catch {, catch (Exception, async void, .Result/.Wait(), new StreamReader without using |
| Python | except:, except Exception, pass after except, open( without with, raise ... in except without from |
| JS / TS | catch (e) {}, catch {}, promises without await/.catch, JSON.parse without try, .then( without .catch( |
| Go | _ = , err assigned but not checked, panic( in libraries, errors.New(err.Error()) |
| C / C++ | unchecked malloc/fopen/fread/write, catch (...), raw new/delete pairs, missing RAII |
| Rust | .unwrap(), .expect( in library code, let _ = on Result |
| Shell | no set -e and unchecked commands, || true hiding failures, missing PIPESTATUS checks |
False positives to drop
Top-level handlers that catch everything to log and exit/return 500 (that's correct at a boundary) · intentionally ignored errors with a comment explaining why · unwrap() in tests, examples or after a check that guarantees success · cleanup code that may fail silently by design (closing in finally, with a comment).
Report
In the user's language, grouped by file:
path/to/file:line - error|warning|info - <ID> <rule> - <what happens when it fails here> - direction: <what the handling should achieve, not the code>- Every finding has a concrete location and describes the concrete failure scenario ("If the file is missing, the function returns an empty list and the caller saves it as valid data").
- Mark findings that depend on code you couldn't see as "possible".
- End with a summary: the project's error strategy as you understood it, findings per severity, then the 3 most important things to fix first.
- Do not change code. Apply fixes only when the user explicitly asks for it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

