Error thrown when an operation execution fails. Use for statement failures, canceled operations, or unexpected states.
Example
throw new ExecutionError("Statement failed: syntax error");
throw new ExecutionError("Statement was canceled");
Extends
Constructors
Constructor
new ExecutionError(message: string, options?: {
cause?: Error;
context?: Record<string, unknown>;
}): ExecutionError;
Parameters
| Parameter | Type |
|---|---|
message | string |
options? | { cause?: Error; context?: Record<string, unknown>; } |
options.cause? | Error |
options.context? | Record<string, unknown> |
Returns
ExecutionError
Inherited from
Properties
cause?
readonly optional cause: Error;
Optional cause of the error
Inherited from
code
readonly code: "EXECUTION_ERROR" = "EXECUTION_ERROR";
Error code for programmatic error handling
Overrides
context?
readonly optional context: Record<string, unknown>;
Additional context for the error
Inherited from
isRetryable
readonly isRetryable: false = false;
Whether this error type is generally safe to retry
Overrides
statusCode
readonly statusCode: 500 = 500;
HTTP status code suggestion (can be overridden)
Overrides
Methods
toJSON()
toJSON(): Record<string, unknown>;
Convert error to JSON for logging/serialization. Sensitive values in context are automatically redacted.
Returns
Record<string, unknown>
Inherited from
toString()
Create a human-readable string representation
Returns
string
Inherited from
canceled()
static canceled(): ExecutionError;
Create an execution error for canceled operation
Returns
ExecutionError
missingData()
static missingData(dataType: string): ExecutionError;
Create an execution error for missing data
Parameters
| Parameter | Type |
|---|---|
dataType | string |
Returns
ExecutionError
resultsClosed()
static resultsClosed(): ExecutionError;
Create an execution error for closed/expired results
Returns
ExecutionError
statementFailed()
static statementFailed(errorMessage?: string): ExecutionError;
Create an execution error for statement failure
Parameters
| Parameter | Type |
|---|---|
errorMessage? | string |
Returns
ExecutionError
unknownState()
static unknownState(state: string): ExecutionError;
Create an execution error for unknown state
Parameters
| Parameter | Type |
|---|---|
state | string |
Returns
ExecutionError