---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# TransformStreamDefaultController.error()

The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded.

## Syntax

```js
error(reason)
```

### Parameters

- `reason`
  - : A string containing the error message to be returned on any further interaction with the stream.

### Return value

None `undefined`.
