Skip to content
← All rules
ErrorsError handling

errors/no-useless-catch-boundaries

Remove catch boundaries that merely rethrow the same error without recovery, cleanup, reporting, translation, or context.

catchrethrowcontrol-flow
TypeScript
try { return await load(); } catch (error) { throw error; }
Finding

Disallow catch handlers that add no behavior.

Setup

Install the package, register its plugin factory, then enable the rule.

Install the package

pnpm add -D @scruple/errors

Register the plugin

In scruple.config.ts, register the factory under the errors namespace used by the rule ID.

import { errors } from "@scruple/errors";

plugins: {
  "errors": errors(),
},

Enable the rule

"errors/no-useless-catch-boundaries": "warn"
Package
@scruple/errors
Default threshold
Plugin default
Minimum confidence
Plugin default

Released under the MIT License.