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

# HookErrorHandler<TCtx>

> Type alias exported by @botmesh/core.

```ts theme={null}
type HookErrorHandler<TCtx> = (ctx, error) => void | Promise<void>;
```

Defined in: [core/types.ts:130](https://github.com/andresayac/botmesh/blob/main/packages/core/src/core/types.ts#L130)

An `error`-phase hook (`bot.onError`): receives the failing context and the error.

## Type Parameters

| Type Parameter | Default type |
| - | - |
|  `TCtx` | `unknown` |

## Parameters

| Parameter | Type |
| - | - |
| `ctx` | `TCtx` |
| `error` | `unknown` |

## Returns

`void` | `Promise`\<`void`>


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