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

# Errors & Enums

> TypeScript API reference for Errors & Enums.

## ZeroRuntimeError

Base for everything this SDK raises on its own behalf.

Catch it to handle any ZeroRuntime failure without naming each one. Errors
the language raises -- `TypeError` for a bad argument, `RangeError` for one
out of bounds -- are left as themselves rather than wrapped.

### Constructor

```ts theme={null}
ZeroRuntimeError(message: string)
```

<ParamField path="message" type="string" default="''" />

***

## SessionRejected

The ZeroRuntime refused to create the session.

### Constructor

```ts theme={null}
SessionRejected(message: string, options: object)
```

<ParamField path="message" type="string" default="''" />

<ParamField path="options" type="object" default="{}" />

***

## ProviderUnavailable

A provider in the pipeline could not be reached or would not serve.

Usually a missing or rejected vendor key, or a model the account is not
entitled to. A fallback on the same slot is what keeps this from ending the
call.

### Constructor

```ts theme={null}
ProviderUnavailable(message: string)
```

<ParamField path="message" type="string" default="''" />

***

## ZeroRuntimeUnreachable

The runtime could not be reached, or did not answer in time.

A transport failure rather than a refusal: nothing was decided about the
session, so retrying is reasonable.

### Constructor

```ts theme={null}
ZeroRuntimeUnreachable(message: string)
```

<ParamField path="message" type="string" default="''" />

***

## ToolTimeout

A `function_tool` did not return before its deadline.

The turn continues without the tool's answer. A tool that calls out to a slow
API wants its own timeout, so it can say something useful instead of being
cut off.

### Constructor

```ts theme={null}
ToolTimeout(message: string)
```

<ParamField path="message" type="string" default="''" />

***

## AgentState

Where the agent is in a turn -- listening, thinking, speaking, or on its way
in or out of the call.

```ts theme={null}
enum AgentState {
  CLOSING = 'closing',
  IDLE = 'idle',
  LISTENING = 'listening',
  SPEAKING = 'speaking',
  STARTING = 'starting',
  THINKING = 'thinking',
}
```

***

## UserState

What the caller is doing, as the runtime reports it.

```ts theme={null}
enum UserState {
  IDLE = 'idle',
  LISTENING = 'listening',
  SPEAKING = 'speaking',
}
```

***

## ChatRole

Who a message in the conversation came from.

A plain string works anywhere one of these is accepted -- the members *are*
strings -- so `'user'` and `ChatRole.USER` are interchangeable.

```ts theme={null}
enum ChatRole {
  ASSISTANT = 'assistant',
  DEVELOPER = 'developer',
  SYSTEM = 'system',
  TOOL = 'tool',
  USER = 'user',
}
```
