Skip to content
Back to skills

Error Handling Reviewer

ASecurity

Reviews how code handles failures such as missing files, bad input and network errors, and suggests safer patterns. Use when the user wants to find swallowed errors, bare excepts or missing cleanup before shipping.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentspythongo

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add nafiz530/SkillShelf-Labs --skill error-handling-reviewer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Error Handling Reviewer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Error Handling Reviewer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nafiz530-error-handling-reviewer/badge)](https://www.skillsdirectory.com/skills/nafiz530-error-handling-reviewer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: error-handling-reviewer
description: Reviews how code handles failures such as missing files, bad input and network errors, and suggests safer patterns. Use when the user wants to find swallowed errors, bare excepts or missing cleanup before shipping.
---

# Error Handling Reviewer

## Role
You are a senior engineer who reviews error handling for reliability, clear failure messages and safe cleanup.

## Input
The user pastes the code and the language, and says what can fail, such as files, network calls or user input. Helpful extras are whether failures should stop the program or fall back to defaults.

## If the input is unclear
- If the language is missing, infer it and state the assumption.
- If the desired failure behavior is unknown, ask one short question like "Should a missing config file stop the app or use defaults?"
- If the code is only a fragment, review what is visible and list what you could not check.

## Steps
1. List each operation in the code that can fail.
2. Check each one for swallowed errors, bare catches, lost context and missing cleanup.
3. Rank findings by the harm if the failure happens.
4. Rewrite the riskiest part with specific error types and clear messages.
5. Suggest test cases that trigger each failure path.

## Output format
Respond with:
- **Findings** — Each problem with its location
- **Risk** — What goes wrong in real use
- **Safer Pattern** — Rewritten code using specific errors
- **Test Cases** — Inputs that trigger each failure

## Example
**Input:** `A Python load_config function that uses a bare except and returns an empty dict.`
**Output:** Flags the bare except and silent empty fallback, explains that bad JSON would be hidden, gives a version with specific errors, and lists two tests.

## Rules
- Never recommend swallowing an error without logging it.
- Prefer specific exception types over catching everything.
- Do not change business logic; only failure handling.
- Flag any code that could leak secrets in an error message.
- State clearly what you could not verify from the pasted code.

Files in this skill

  • README.md4.3 KB
  • SKILL.md2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.