# TSR1303: Only Error objects can be thrown in sound mode; '…' is not assignable to 'Error'.

> A non-Error value is thrown or passed to Promise.reject. Throw an Error instance (or a subclass) instead.

## What it means

Only `Error` instances may be thrown or passed to `Promise.reject` in sound files, so catch blocks can rely on `message` and `stack`. Re-throwing the catch variable is allowed. It's reported at the thrown or rejected expression.

## Example

```ts
// Only Error objects may be thrown.
function fail(reason: string): never {
  throw "failed: " + reason; // @expect TSR1303
}
export const n: number = Math.random() > 2 ? fail("x") : 1;
```

## How to fix

- Throw an `Error` or a subclass: `throw new Error("failed: " + reason)`.
- Use `Promise.reject(new Error(...))` for rejections.

Sound mode is defined in [design record 0007](https://github.com/Webb-Ventures/typescript-rust/blob/main/docs/design/0007-sound-mode.md) (accepted 2026-10-15).

Source: https://ts-r.dev/errors/TSR1303/
