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
| Name | Type |
|---|---|
context | IErrorHandlingContextData |
Returns
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:
- Strict primitive types (loses debugging information)
- Interface definitions (too rigid for error contexts)
- Union types (becomes unwieldy for error data)
- Generic constraints (too complex for error handling)
- Type assertions (decreases type safety) TODO: Consider standardized error context interface if patterns emerge
Parameters
| Name | Type |
|---|---|
context | IErrorHandlingContextData |
additionalData? | TErrorContextData |
Returns
TErrorContextData