Skip to content

agent-plugin-error-handling / Exports

agent-plugin-error-handling

Table of contents

Classes

Interfaces

Type Aliases

Functions

Type Aliases

TErrorHandlingStrategy

Ƭ TErrorHandlingStrategy: "simple" | "circuit-breaker" | "exponential-backoff" | "silent"

Error handling strategy types

Defined in

agent-plugin-error-handling/src/types.ts:17

Functions

toErrorContext

toErrorContext(context): IErrorContextAdapter

Convert IErrorHandlingContextData to ErrorContextData-compatible format for PluginError REASON: Simple object spread with known properties to avoid index signature conflicts ALTERNATIVES_CONSIDERED: Complex type adapters (unnecessary), Object.assign (verbose), bracket notation (rejected by TS), type assertions (reduces safety) TODO: Consider unified error context type system across all plugins

Parameters

NameType
contextIErrorHandlingContextData

Returns

IErrorContextAdapter

Defined in

agent-plugin-error-handling/src/context-adapter.ts:18


createPluginErrorContext

createPluginErrorContext(context, additionalData?): TErrorContextData

Safe context extraction for PluginError with nested context structure

REASON: PluginError context needs flexible data structure for debugging information ALTERNATIVES_CONSIDERED:

  1. Strict primitive types (loses debugging information)
  2. Interface definitions (too rigid for error contexts)
  3. Union types (becomes unwieldy for error data)
  4. Generic constraints (too complex for error handling)
  5. Type assertions (decreases type safety) TODO: Consider standardized error context interface if patterns emerge

Parameters

NameType
contextIErrorHandlingContextData
additionalData?TErrorContextData

Returns

TErrorContextData

Defined in

agent-plugin-error-handling/src/context-adapter.ts:40

Released under the MIT License.