Class: ErrorUtils
Error utility functions
Table of contents
Constructors
Methods
Constructors
constructor
• new ErrorUtils(): ErrorUtils
Returns
Methods
isRecoverable
▸ isRecoverable(error): boolean
Check if error is recoverable
Parameters
| Name | Type |
|---|---|
error | Error |
Returns
boolean
Defined in
packages/agents/src/utils/errors.ts:222
getErrorCode
▸ getErrorCode(error): string
Extract error code from any error
Parameters
| Name | Type |
|---|---|
error | Error |
Returns
string
Defined in
packages/agents/src/utils/errors.ts:232
fromUnknown
▸ fromUnknown(error, defaultMessage?): RobotaError
Create error from unknown value
Parameters
| Name | Type | Default value |
|---|---|---|
error | ErrorExternalInput | undefined |
defaultMessage | string | 'An unknown error occurred' |
Returns
Defined in
packages/agents/src/utils/errors.ts:242
wrapProviderError
▸ wrapProviderError(error, provider, operation): ProviderError
Wrap external errors
Parameters
| Name | Type |
|---|---|
error | ErrorExternalInput |
provider | string |
operation | string |