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

# OnError

> Subscribe to error events.

## Import

```ts theme={null}
import { Orderbook } from '@krono/core'
```

## Usage

Triggers whenever the WebSocket or the internal processing logic encounters an error.

```ts theme={null}
orderbook.onError((error) => {
  console.error('Orderbook Error:', error.message)
})
```

## Parameters

### callback

`(error: Error) => void`

## Return Type

```ts theme={null}
void
```
