<!--
 ⚠️  AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
 This file is automatically generated by scripts/docs-generator.js
 To make changes, edit the source TypeScript files or update the generator script
-->

[agents](../../) / [Exports](../modules) / ErrorHandlingPlugin

# Class: ErrorHandlingPlugin

Plugin for handling errors with configurable strategies
Provides error recovery, retry mechanisms, and circuit breaker patterns

## Hierarchy

- [`AbstractPlugin`](AbstractPlugin)\<[`ErrorHandlingPluginOptions`](../interfaces/ErrorHandlingPluginOptions), `ErrorHandlingPluginStats`\>

  ↳ **`ErrorHandlingPlugin`**

## Table of contents

### Constructors

- [constructor](ErrorHandlingPlugin#constructor)

### Properties

- [enabled](ErrorHandlingPlugin#enabled)
- [category](ErrorHandlingPlugin#category)
- [priority](ErrorHandlingPlugin#priority)
- [name](ErrorHandlingPlugin#name)
- [version](ErrorHandlingPlugin#version)

### Methods

- [initialize](ErrorHandlingPlugin#initialize)
- [subscribeToModuleEvents](ErrorHandlingPlugin#subscribetomoduleevents)
- [unsubscribeFromModuleEvents](ErrorHandlingPlugin#unsubscribefrommoduleevents)
- [dispose](ErrorHandlingPlugin#dispose)
- [enable](ErrorHandlingPlugin#enable)
- [disable](ErrorHandlingPlugin#disable)
- [isEnabled](ErrorHandlingPlugin#isenabled)
- [getConfig](ErrorHandlingPlugin#getconfig)
- [updateConfig](ErrorHandlingPlugin#updateconfig)
- [getData](ErrorHandlingPlugin#getdata)
- [clearData](ErrorHandlingPlugin#cleardata)
- [getStatus](ErrorHandlingPlugin#getstatus)
- [beforeRun](ErrorHandlingPlugin#beforerun)
- [afterRun](ErrorHandlingPlugin#afterrun)
- [beforeExecution](ErrorHandlingPlugin#beforeexecution)
- [afterExecution](ErrorHandlingPlugin#afterexecution)
- [beforeConversation](ErrorHandlingPlugin#beforeconversation)
- [afterConversation](ErrorHandlingPlugin#afterconversation)
- [beforeToolCall](ErrorHandlingPlugin#beforetoolcall)
- [beforeToolExecution](ErrorHandlingPlugin#beforetoolexecution)
- [afterToolCall](ErrorHandlingPlugin#aftertoolcall)
- [afterToolExecution](ErrorHandlingPlugin#aftertoolexecution)
- [beforeProviderCall](ErrorHandlingPlugin#beforeprovidercall)
- [afterProviderCall](ErrorHandlingPlugin#afterprovidercall)
- [onStreamingChunk](ErrorHandlingPlugin#onstreamingchunk)
- [onError](ErrorHandlingPlugin#onerror)
- [onMessageAdded](ErrorHandlingPlugin#onmessageadded)
- [onModuleEvent](ErrorHandlingPlugin#onmoduleevent)
- [handleError](ErrorHandlingPlugin#handleerror)
- [executeWithRetry](ErrorHandlingPlugin#executewithretry)
- [resetCircuitBreaker](ErrorHandlingPlugin#resetcircuitbreaker)
- [getStats](ErrorHandlingPlugin#getstats)
- [destroy](ErrorHandlingPlugin#destroy)

## Constructors

### constructor

• **new ErrorHandlingPlugin**(`options`): [`ErrorHandlingPlugin`](ErrorHandlingPlugin)

#### Parameters

| Name      | Type                                                                     |
| :-------- | :----------------------------------------------------------------------- |
| `options` | [`ErrorHandlingPluginOptions`](../interfaces/ErrorHandlingPluginOptions) |

#### Returns

[`ErrorHandlingPlugin`](ErrorHandlingPlugin)

#### Overrides

[AbstractPlugin](AbstractPlugin).[constructor](AbstractPlugin#constructor)

#### Defined in

[packages/agents/src/plugins/error-handling/error-handling-plugin.ts:27](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/error-handling/error-handling-plugin.ts#L27)

## Properties

### enabled

• **enabled**: `boolean` = `true`

Plugin enabled state

#### Inherited from

[AbstractPlugin](AbstractPlugin).[enabled](AbstractPlugin#enabled)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:307](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L307)

---

### category

• **category**: [`PluginCategory`](../enums/PluginCategory) = `PluginCategory.CUSTOM`

Plugin category for classification

#### Inherited from

[AbstractPlugin](AbstractPlugin).[category](AbstractPlugin#category)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:310](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L310)

---

### priority

• **priority**: `number` = `PluginPriority.NORMAL`

Plugin priority for execution order

#### Inherited from

[AbstractPlugin](AbstractPlugin).[priority](AbstractPlugin#priority)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:313](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L313)

---

### name

• **name**: `string` = `'ErrorHandlingPlugin'`

Plugin name

#### Overrides

[AbstractPlugin](AbstractPlugin).[name](AbstractPlugin#name)

#### Defined in

[packages/agents/src/plugins/error-handling/error-handling-plugin.ts:18](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/error-handling/error-handling-plugin.ts#L18)

---

### version

• **version**: `string` = `'1.0.0'`

Plugin version

#### Overrides

[AbstractPlugin](AbstractPlugin).[version](AbstractPlugin#version)

#### Defined in

[packages/agents/src/plugins/error-handling/error-handling-plugin.ts:19](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/error-handling/error-handling-plugin.ts#L19)

## Methods

### initialize

▸ **initialize**(`options?`): `Promise`\<`void`\>

Initialize the plugin with type-safe options

#### Parameters

| Name       | Type                                                                     |
| :--------- | :----------------------------------------------------------------------- |
| `options?` | [`ErrorHandlingPluginOptions`](../interfaces/ErrorHandlingPluginOptions) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[initialize](AbstractPlugin#initialize)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:338](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L338)

---

### subscribeToModuleEvents

▸ **subscribeToModuleEvents**(`eventEmitter`): `Promise`\<`void`\>

Subscribe to module events through EventEmitter

#### Parameters

| Name           | Type                                       |
| :------------- | :----------------------------------------- |
| `eventEmitter` | [`EventEmitterPlugin`](EventEmitterPlugin) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[subscribeToModuleEvents](AbstractPlugin#subscribetomoduleevents)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:366](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L366)

---

### unsubscribeFromModuleEvents

▸ **unsubscribeFromModuleEvents**(`eventEmitter`): `Promise`\<`void`\>

Unsubscribe from module events

#### Parameters

| Name           | Type                                       |
| :------------- | :----------------------------------------- |
| `eventEmitter` | [`EventEmitterPlugin`](EventEmitterPlugin) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[unsubscribeFromModuleEvents](AbstractPlugin#unsubscribefrommoduleevents)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:423](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L423)

---

### dispose

▸ **dispose**(): `Promise`\<`void`\>

Cleanup plugin resources

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[dispose](AbstractPlugin#dispose)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:438](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L438)

---

### enable

▸ **enable**(): `void`

Enable the plugin

#### Returns

`void`

#### Inherited from

[AbstractPlugin](AbstractPlugin).[enable](AbstractPlugin#enable)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:450](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L450)

---

### disable

▸ **disable**(): `void`

Disable the plugin

#### Returns

`void`

#### Inherited from

[AbstractPlugin](AbstractPlugin).[disable](AbstractPlugin#disable)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:457](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L457)

---

### isEnabled

▸ **isEnabled**(): `boolean`

Check if plugin is enabled

#### Returns

`boolean`

#### Inherited from

[AbstractPlugin](AbstractPlugin).[isEnabled](AbstractPlugin#isenabled)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:464](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L464)

---

### getConfig

▸ **getConfig**(): [`IPluginConfig`](../interfaces/IPluginConfig)

Get plugin configuration

#### Returns

[`IPluginConfig`](../interfaces/IPluginConfig)

#### Inherited from

[AbstractPlugin](AbstractPlugin).[getConfig](AbstractPlugin#getconfig)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:471](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L471)

---

### updateConfig

▸ **updateConfig**(`_config`): `void`

Update plugin configuration

#### Parameters

| Name      | Type                                           |
| :-------- | :--------------------------------------------- |
| `_config` | [`IPluginConfig`](../interfaces/IPluginConfig) |

#### Returns

`void`

#### Inherited from

[AbstractPlugin](AbstractPlugin).[updateConfig](AbstractPlugin#updateconfig)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:478](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L478)

---

### getData

▸ **getData**(): [`IPluginData`](../interfaces/IPluginData)

Get plugin data - enhanced with classification information

#### Returns

[`IPluginData`](../interfaces/IPluginData)

#### Inherited from

[AbstractPlugin](AbstractPlugin).[getData](AbstractPlugin#getdata)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:485](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L485)

---

### clearData

▸ **clearData**(): `void`

Clear plugin data - common interface for all plugins
This method should be implemented by plugins that store data

#### Returns

`void`

#### Inherited from

[AbstractPlugin](AbstractPlugin).[clearData](AbstractPlugin#cleardata)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:505](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L505)

---

### getStatus

▸ **getStatus**(): `Object`

Get plugin status - enhanced with classification information

#### Returns

`Object`

| Name                    | Type                                        |
| :---------------------- | :------------------------------------------ |
| `name`                  | `string`                                    |
| `version`               | `string`                                    |
| `enabled`               | `boolean`                                   |
| `initialized`           | `boolean`                                   |
| `category`              | [`PluginCategory`](../enums/PluginCategory) |
| `priority`              | `number`                                    |
| `subscribedEventsCount` | `number`                                    |
| `hasEventEmitter`       | `boolean`                                   |

#### Inherited from

[AbstractPlugin](AbstractPlugin).[getStatus](AbstractPlugin#getstatus)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:510](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L510)

---

### beforeRun

▸ **beforeRun**(`input`, `options?`): `Promise`\<`void`\>

Called before agent run

#### Parameters

| Name       | Type                                       |
| :--------- | :----------------------------------------- |
| `input`    | `string`                                   |
| `options?` | [`IRunOptions`](../interfaces/IRunOptions) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[beforeRun](AbstractPlugin#beforerun)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:564](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L564)

---

### afterRun

▸ **afterRun**(`input`, `response`, `options?`): `Promise`\<`void`\>

Called after agent run

#### Parameters

| Name       | Type                                       |
| :--------- | :----------------------------------------- |
| `input`    | `string`                                   |
| `response` | `string`                                   |
| `options?` | [`IRunOptions`](../interfaces/IRunOptions) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[afterRun](AbstractPlugin#afterrun)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:565](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L565)

---

### beforeExecution

▸ **beforeExecution**(`context`): `Promise`\<`void`\>

Called before execution with context

#### Parameters

| Name      | Type                                                               |
| :-------- | :----------------------------------------------------------------- |
| `context` | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[beforeExecution](AbstractPlugin#beforeexecution)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:566](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L566)

---

### afterExecution

▸ **afterExecution**(`context`, `result`): `Promise`\<`void`\>

Called after execution with context and result

#### Parameters

| Name      | Type                                                               |
| :-------- | :----------------------------------------------------------------- |
| `context` | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |
| `result`  | [`IPluginExecutionResult`](../interfaces/IPluginExecutionResult)   |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[afterExecution](AbstractPlugin#afterexecution)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:567](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L567)

---

### beforeConversation

▸ **beforeConversation**(`context`): `Promise`\<`void`\>

Called before conversation with context

#### Parameters

| Name      | Type                                                               |
| :-------- | :----------------------------------------------------------------- |
| `context` | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[beforeConversation](AbstractPlugin#beforeconversation)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:568](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L568)

---

### afterConversation

▸ **afterConversation**(`context`, `result`): `Promise`\<`void`\>

Called after conversation with context and result

#### Parameters

| Name      | Type                                                               |
| :-------- | :----------------------------------------------------------------- |
| `context` | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |
| `result`  | [`IPluginExecutionResult`](../interfaces/IPluginExecutionResult)   |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[afterConversation](AbstractPlugin#afterconversation)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:569](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L569)

---

### beforeToolCall

▸ **beforeToolCall**(`toolName`, `parameters`): `Promise`\<`void`\>

Called before tool execution

#### Parameters

| Name         | Type                                            |
| :----------- | :---------------------------------------------- |
| `toolName`   | `string`                                        |
| `parameters` | [`TToolParameters`](../modules#ttoolparameters) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[beforeToolCall](AbstractPlugin#beforetoolcall)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:570](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L570)

---

### beforeToolExecution

▸ **beforeToolExecution**(`context`, `toolData`): `Promise`\<`void`\>

Called before tool execution with context

#### Parameters

| Name       | Type                                                               |
| :--------- | :----------------------------------------------------------------- |
| `context`  | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |
| `toolData` | [`IToolExecutionContext`](../interfaces/IToolExecutionContext)     |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[beforeToolExecution](AbstractPlugin#beforetoolexecution)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:571](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L571)

---

### afterToolCall

▸ **afterToolCall**(`toolName`, `parameters`, `result`): `Promise`\<`void`\>

Called after tool execution

#### Parameters

| Name         | Type                                                         |
| :----------- | :----------------------------------------------------------- |
| `toolName`   | `string`                                                     |
| `parameters` | [`TToolParameters`](../modules#ttoolparameters)              |
| `result`     | [`IToolExecutionResult`](../interfaces/IToolExecutionResult) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[afterToolCall](AbstractPlugin#aftertoolcall)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:572](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L572)

---

### afterToolExecution

▸ **afterToolExecution**(`context`, `toolResults`): `Promise`\<`void`\>

Called after tool execution with context

#### Parameters

| Name          | Type                                                               |
| :------------ | :----------------------------------------------------------------- |
| `context`     | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |
| `toolResults` | [`IPluginExecutionResult`](../interfaces/IPluginExecutionResult)   |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[afterToolExecution](AbstractPlugin#aftertoolexecution)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:573](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L573)

---

### beforeProviderCall

▸ **beforeProviderCall**(`messages`): `Promise`\<`void`\>

Called before AI provider call

#### Parameters

| Name       | Type                                                  |
| :--------- | :---------------------------------------------------- |
| `messages` | [`TUniversalMessage`](../modules#tuniversalmessage)[] |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[beforeProviderCall](AbstractPlugin#beforeprovidercall)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:574](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L574)

---

### afterProviderCall

▸ **afterProviderCall**(`messages`, `response`): `Promise`\<`void`\>

Called after AI provider call

#### Parameters

| Name       | Type                                                  |
| :--------- | :---------------------------------------------------- |
| `messages` | [`TUniversalMessage`](../modules#tuniversalmessage)[] |
| `response` | [`TUniversalMessage`](../modules#tuniversalmessage)   |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[afterProviderCall](AbstractPlugin#afterprovidercall)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:575](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L575)

---

### onStreamingChunk

▸ **onStreamingChunk**(`chunk`): `Promise`\<`void`\>

Called on streaming chunk

#### Parameters

| Name    | Type                                                |
| :------ | :-------------------------------------------------- |
| `chunk` | [`TUniversalMessage`](../modules#tuniversalmessage) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[onStreamingChunk](AbstractPlugin#onstreamingchunk)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:576](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L576)

---

### onError

▸ **onError**(`error`, `context?`): `Promise`\<`void`\>

Called on error

#### Parameters

| Name       | Type                                                       |
| :--------- | :--------------------------------------------------------- |
| `error`    | `Error`                                                    |
| `context?` | [`IPluginErrorContext`](../interfaces/IPluginErrorContext) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[onError](AbstractPlugin#onerror)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:577](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L577)

---

### onMessageAdded

▸ **onMessageAdded**(`message`): `Promise`\<`void`\>

Called on message added to history

#### Parameters

| Name      | Type                                                |
| :-------- | :-------------------------------------------------- |
| `message` | [`TUniversalMessage`](../modules#tuniversalmessage) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[onMessageAdded](AbstractPlugin#onmessageadded)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:578](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L578)

---

### onModuleEvent

▸ **onModuleEvent**(`eventType`, `eventData`): `Promise`\<`void`\>

Called when module events are received

#### Parameters

| Name        | Type                                   |
| :---------- | :------------------------------------- |
| `eventType` | [`EventType`](../modules#eventtype)    |
| `eventData` | [`EventData`](../interfaces/EventData) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[onModuleEvent](AbstractPlugin#onmoduleevent)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:579](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L579)

---

### handleError

▸ **handleError**(`error`, `context?`): `Promise`\<`void`\>

Handle an error with the configured strategy

#### Parameters

| Name      | Type                       |
| :-------- | :------------------------- |
| `error`   | `Error`                    |
| `context` | `ErrorHandlingContextData` |

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/plugins/error-handling/error-handling-plugin.ts:61](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/error-handling/error-handling-plugin.ts#L61)

---

### executeWithRetry

▸ **executeWithRetry**\<`T`\>(`fn`, `context?`): `Promise`\<`T`\>

Execute a function with error handling and retry logic
REASON: PluginError constructor requires ErrorContextData which has different type constraints than ErrorHandlingContextData, causing multiple type compatibility issues
ALTERNATIVES_CONSIDERED: Union types (breaks existing error context interfaces), interface definition (creates circular dependencies), generic types (complex type propagation through error handling chain), conditional types (breaks existing plugin interfaces), mapped types (incompatible with error constructor signatures), type guards (runtime only, doesn't solve constructor compatibility), custom declarations (breaks PluginError interface contract), code refactoring (would require redesigning entire error handling system across all plugins),

#### Type parameters

| Name |
| :--- |
| `T`  |

#### Parameters

| Name      | Type                       |
| :-------- | :------------------------- |
| `fn`      | () => `Promise`\<`T`\>     |
| `context` | `ErrorHandlingContextData` |

#### Returns

`Promise`\<`T`\>

**`Types`**

packages (none available for this specific use case), external library integration (no standard error context type systems available), utility types (Pick/Omit create new compatibility issues)
TODO: Create unified error context type system that bridges ErrorHandlingContextData and ErrorContextData requirements, or redesign PluginError to accept more flexible context types

#### Defined in

[packages/agents/src/plugins/error-handling/error-handling-plugin.ts:108](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/error-handling/error-handling-plugin.ts#L108)

---

### resetCircuitBreaker

▸ **resetCircuitBreaker**(): `void`

Reset circuit breaker state

#### Returns

`void`

#### Defined in

[packages/agents/src/plugins/error-handling/error-handling-plugin.ts:169](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/error-handling/error-handling-plugin.ts#L169)

---

### getStats

▸ **getStats**(): `ErrorHandlingPluginStats`

Get error handling statistics

#### Returns

`ErrorHandlingPluginStats`

#### Overrides

[AbstractPlugin](AbstractPlugin).[getStats](AbstractPlugin#getstats)

#### Defined in

[packages/agents/src/plugins/error-handling/error-handling-plugin.ts:179](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/error-handling/error-handling-plugin.ts#L179)

---

### destroy

▸ **destroy**(): `Promise`\<`void`\>

Cleanup resources

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/plugins/error-handling/error-handling-plugin.ts:194](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/error-handling/error-handling-plugin.ts#L194)
