fleetlint Policy for a fleet of repositories
v0.3
Getting started

slop/swallowed-errors

Errors are not swallowed

Severityinfo
Tiersall
Stacksany
Scoperoot
Kindexpr
Sourcelibrary v0.0.0-20261011205826-ecb4e9b3ffd4
Selected byfleetlint-slop@0.1.0

Requirement

No empty catch blocks, no except: pass, no _ = err. Only single-line forms are detected; the stack’s linter covers the rest.

Why

A swallowed error turns a failure with a cause into a wrong result without one.

Check

For each item in:

codegrep("nontest", r'catch\s*(\([^)]*\))?\s*\{\s*\}|except[^:]*:\s*pass\b|\b_\s*=\s*err\b|\.catch\(\s*\(\)\s*=>\s*(\{\s*\}|null|undefined)\s*\)|catch \(_\)')
false

Fix

Handle the error, wrap and return it, or log it where it is handled.

Agent instruction: Propagate the error with context unless the surrounding code shows it is safe to ignore; then say why in a comment.

See: https://fleetlint.org/baseline/#slop


Generated by fleetlint docs from catalog v0.0.0-20261011205826-ecb4e9b3ffd4.