Exception Swallowing Guard
Recognizes bounded high-confidence empty catch, except, rescue, and promise-rejection handlers and blocks only when the proposed revision adds swallowing behavior.
Runs on
What it does
Block newly added empty exception handlers and ignored promise rejections.
When it fires
- implementation
- pre-commit
How it behaves
Block newly added empty exception handlers and ignored promise rejections.
It does not require a particular logging library.
It does not reject handlers that rethrow, return a documented fallback, or record an error.
It does not reject an empty handler documented by a comment, or the `except ImportError`/`ModuleNotFoundError` optional-dependency fallback.
It does not prove that every error path is handled.
Configuration
targets/claude-code/exception-swallowing-guard.mjs
- Version
- 1.1.0
- Requires
- node
- Licence
- RiskThis automatic gate blocks newly added empty exception handlers and ignored promise rejections; a false denial can interrupt legitimate work, but it does not execute the blocked action.
- Medium
- ModeHow it works: fixed rules, model instructions, or both.
- Deterministic only
- Behaviour
- Enforces, blocks on violation
- On failure
- Denies and blocks
- LatencyThe entrypoint handles one intercepted event to block newly added empty exception handlers and ignored promise rejections without deferred work.
- Immediate
- Data retentionWhether data remains after use and who manages its storage.
- Not retained
Often used with
All in Development