---
url: https://scruple.dev/rules/errors/no-lossy-error-wrapping.md
description: Disallow replacement errors that lose the original cause.
---

# errors/no-lossy-error-wrapping

Disallow replacement errors that lose the original cause.

## What it checks

When a catch handler throws a replacement error, preserve the original failure with a structured cause rather than discarding it.

## Rule metadata

* Package: `@scruple/errors`
* Category: Error handling
* Tags: cause, wrapping, exceptions
* Default threshold: `plugin default`
* Minimum confidence: `plugin default`

## Examples

### Reported

```ts
try { await load(); } catch { throw new Error("Load failed"); }
```

### Accepted

```ts
try { await load(); } catch (cause) { throw new Error("Load failed", { cause }); }
```
