# TSR1302: Exported '…' can throw '…' but has no '@throws' tag. Document it with a '@throws' tag.

> Opt-in: an exported function or public method can throw but has no '@throws' tag. Document what it throws with a '@throws' tag.

## What it means

This check is off by default. With `exports-declare-throws = true` in the `[sound]` configuration, an exported function, or a public method of an exported class, whose throws set isn't empty must declare it with `@throws` tags, so callers in other files and packages know what to handle. It's reported at the declaration name. Without the switch, only functions that already have `@throws` tags are held to them ([TSR1301](https://ts-r.dev/errors/TSR1301/)).

## Example

With `exports-declare-throws = true`:

```ts
// An exported function that throws without a @throws tag.
export function port(text: string): number { // @expect TSR1302
  const n = Number(text);
  if (!Number.isInteger(n)) throw new RangeError("not a port");
  return n;
}
```

## How to fix

- Add the tag: `/** @throws {RangeError} */`.
- Or catch inside and return a value instead (`Row | null`).
- In the editor, the quick fix inserts the missing tags from the computed throws set.

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/TSR1302/
