Unproduced catch tags
What an unproduced-catch-tag finding of fallow dead-code means, why it matters and how to fix it.
What it reports
A catchTag handler names a project error tag that no code produces.
Dead code explains how fallow finds it.
Why it matters
A catchTag("X", ...) or catchTags({ X: ... }) handler where every project class with tag X is never constructed or failed with, and no object literal _tag: "X" or tagged constructor produces the tag. A tag that no project class declares can come from a package, so the rule abstains. Effect built-in tags such as TimeoutException are never reported. The rule reports a handler only when no unused-tagged-error finding covers its classes: the error rule is off, or its finding is suppressed. Default warn. The check runs only when the project declares effect.
Example
main.ts calls Effect.catchTag("Expired", ...), the only class with tag Expired is never constructed, and the unused-tagged-error finding for it is suppressed.
Fix
Remove the handler, or fail with the error where the condition occurs. If a package or code outside the project produces the tag, suppress the line with // fallow-ignore-next-line unproduced-catch-tag.
Facts
| Fact | Value |
|---|---|
| Issue type | unproduced-catch-tag |
| Rule id in SARIF output | fallow/unproduced-catch-tag |
| Command | fallow dead-code |
| Default severity | warn |
Config key in rules | unproduced-catch-tags |
| Filter option | --unproduced-catch-tags |
| Suppression comment | // fallow-ignore-next-line unproduced-catch-tag |
Fixable with fallow fix | No |
| Opt-in | No |