AgentExpressError
Base error class for all Agent Express errors.
Every error in the framework extends this class, providing a machine-readable
code, a retryable flag for middleware like turn.retry(), and an optional
cause for error chaining.
Example
Section titled “Example”try { await agent.run({ input: "test" }).result} catch (err) { if (err instanceof AgentExpressError) { console.log(err.code, err.retryable) }}Extends
Section titled “Extends”Error
Extended by
Section titled “Extended by”AbortErrorModelErrorToolDeniedErrorToolExecutionErrorSessionClosedErrorSessionBusyErrorStructuredOutputParseErrorStructuredOutputValidationErrorBudgetExceededErrorInputGuardrailErrorOutputGuardrailErrorTurnTimeoutError
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AgentExpressError(
message,code,retryable,cause?):AgentExpressError
Parameters
Section titled “Parameters”message
Section titled “message”string
string
retryable
Section titled “retryable”boolean
cause?
Section titled “cause?”Error
Returns
Section titled “Returns”AgentExpressError
Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”cause?
Section titled “cause?”
readonlyoptionalcause?:Error
Original error that caused this one, if any.
Overrides
Section titled “Overrides”Error.cause
code:
string
Machine-readable error code (e.g., “ABORT”, “RATE_LIMIT”, “TOOL_DENIED”).
retryable
Section titled “retryable”
readonlyretryable:boolean
Whether this error can be retried by retry middleware.