> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> Error types thrown by the Pipecat JavaScript client: RTVIError and its subclasses, and how to catch and handle each.

## RTVIError Type

Base `PipecatClient` error type, extends [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) and primarily introduces the `status` field. Most methods will try to throw an error of this type when something goes wrong. This is different from the RTVI error event and its corresponding [`onError` callback](./callbacks#param-on-error), which report errors sent by the bot and some client-side failures.

**status** `number | undefined`

A unique identifier (or HTTP code if applicable) for the error.

**message** `string`

A human-readable message describing the error.

## Pre-defined RTVIErrors

### ConnectionTimeoutError

Reserved for a connection that times out. The client itself does not raise it (`connect()` applies no timeout of its own), so it appears only if a transport raises it.

### BotAlreadyStartedError

Thrown by `startBot()`, `connect()` or `startBotAndConnect()` when the client is already started. Call `disconnect()` before starting again.

### MessageTooLargeError

Thrown when a message exceeds the transport's maximum size: 64 KiB by default. Most likely when sending images or a large context through `sendClientMessage()`.

### StartBotError

Emitted from `startBot()` or `startBotAndConnect()` when the endpoint responds with an error or the `fetch` itself fails. This may be due to the endpoint being unavailable, or the server failing to parse the provided data.

**error** `string` *required*

All `StartBotError` instances will have an `error` field set to
`invalid-request-error`.

**status** `number` (default: 500)

HTTP status code returned by the endpoint. `500` when there was no HTTP
response, such as a network failure or timeout.

**message** `string`

Verbose error message returned by the endpoint, if provided. To take advantage
of this, the endpoint should return an error response with a JSON object with
an `info` or `detail` field containing the error message. Without either, the
response's status text is used.

### TransportStartError

Emitted when the Transport is not able to connect. You may need to check the connection parameters provided or returned from your endpoint.

### InvalidTransportParamsError

Exported, but neither the client nor the official transports raise it: `connect()` reports invalid connection parameters as a plain `RTVIError`.

### BotNotReadyError

Emitted when the client attempts to perform an action or method that requires the bot to be in a ready state, but the bot is not ready. You must call `connect()` first and wait for the bot to be ready before performing such actions.

### DeviceError

Emitted when there is an issue with acquiring or using a media device, such as a camera or microphone. This could be due to permissions issues, device unavailability, or other related problems.

**devices** `array\<'cam' | 'mic' | 'speaker'\>` *required*

List of media devices, `'cam'`, `'mic'`, and/or `'speaker'`, that are
unavailable or could not be accessed.

**type** `string` *required*

The `type` field will indicate what type of device error occurred. Options include:

* `"in-use"`: A device is currently in use by another application and cannot be accessed. *windows only*
* `"permissions"`: The user has not granted permission to access the media device.
* `"undefined-mediadevices"`: `getUserMedia()` is not an available API on the current platform or browser.
* `"not-found"`: The specified media device could not be found.
* `"constraints"`: The media device could not be configured with the specified constraints.
* `"unknown"`: An unknown error occurred while accessing the media device.

**details** `object`

Additional details about the device error, if available.

### UnsupportedFeatureError

Thrown when a feature is requested that the current transport or bot does not support. `sendDTMF()` and `sendFile()` throw it for bots on an older RTVI protocol. For `enableCam()`, `enableScreenShare()`, and `selectedCam`, the client passes it to the [`onUnsupportedFeature`](./callbacks#messages-and-errors) callback instead of throwing.

**feature** `string` *required*

This custom field will contain the name of the unsupported feature.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.