agentsclimarketplace

Empty catch finder

Skill dcs-soni/skills/empty-catch-finder

A collection of custom Claude Code Skills to supercharge your development workflow.From the repository description

Install
npx -y skills add dcs-soni/skills --skill empty-catch-finder

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
  • runs commandsInstructs the agent to run 2 commands, including `python scripts/find_empty_catches.py <directory>` and 1 more.

SKILL.md

3.8 KB, 849 tokens by cl100k_base, as published. Nobody here has run it

Empty Catch Block Finder

Detect silent error handlers that cause mysterious production failures.

Why This Matters

Empty catch blocks are silent killers:

try {
  await saveOrder(order);
} catch (e) {
  // Silent failure - order lost, no evidence
}

This skill finds them before they cause production incidents.

Quick Start

Empty Catch Analysis:
- [ ] Step 1: Scan for empty catch blocks
- [ ] Step 2: Assess risk level
- [ ] Step 3: Generate fix suggestions

Workflow

Step 1: Scan for Empty Catches

Find all empty/silent catch blocks:

python scripts/find_empty_catches.py <directory>

Detects:

  • catch (e) {} - completely empty
  • catch (e) { /* comment */ } - only comments
  • except: pass - Python silent pass
  • if err != nil { } - Go ignored errors
  • catch { return; } - silent returns

Step 2: Assess Risk Level

Each catch is categorized by risk:

RiskPatternWhy Dangerous
πŸ”΄ CriticalEmpty catch in async/database codeData loss, corruption
🟠 HighEmpty catch in API handlersSilent failures to users
🟑 MediumEmpty catch in utilitiesHidden bugs
🟒 LowEmpty catch in tests/scriptsUsually intentional

Step 3: Generate Fix Suggestions

Get suggested fixes:

python scripts/generate_fixes.py <directory> --output fixes.md

Fix patterns:

// ❌ Before: Silent failure
catch (e) {}

// βœ… After: Logged + handled
catch (e) {
  logger.error('Order save failed', { error: e, orderId: order.id });
  throw new OrderSaveError('Failed to save order', { cause: e });
}

Utility Scripts

ScriptPurpose
find_empty_catches.pyFind empty catch blocks
generate_fixes.pySuggest proper error handling

Language Support

LanguagePatterns Detected
JavaScript/TypeScriptcatch (e) {}, catch {}
Pythonexcept: pass, except Exception: ...
Javacatch (Exception e) {}
Goif err != nil { } (empty body)
C#catch (Exception) {}

See PATTERNS.md for full pattern reference.


Example

User: "Find silent error handlers in my codebase"

Output:

Found 8 empty catch blocks

πŸ”΄ CRITICAL (2)
  src/services/payment.ts:45
    catch (e) {} // In async payment processing!

  src/db/users.ts:112
    catch (e) { return null; } // Hides DB errors

🟠 HIGH (3)
  src/api/orders.ts:78
    catch (error) { /* TODO: handle */ }

  ...

Integration with Linting

After fixing, prevent new empty catches:

ESLint:

{ "rules": { "no-empty": ["error", { "allowEmptyCatch": false }] } }

Python (Ruff):

[tool.ruff]
select = ["E722"]  # bare-except

Related Skills

  • incident-response-helper β€” Debug issues caused by silent failures
  • stale-todo-finder β€” Find // TODO: handle error comments

What ships with it: 4 files

18.1 KB alongside SKILL.md, 2 of them executable

scripts/

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.