Documentation / @agentick/shared / AbortError
Class: AbortError
Defined in: errors.ts:193
Error thrown when an operation is aborted or cancelled.
Example
throw new AbortError('User cancelled the operation');
throw new AbortError('Operation timed out', 'ABORT_TIMEOUT', { timeoutMs: 30000 });Extends
Constructors
Constructor
new AbortError(
message?,code?,details?,cause?):AbortError
Defined in: errors.ts:194
Parameters
message?
string = "Operation aborted"
code?
"ABORT_CANCELLED" | "ABORT_TIMEOUT" | "ABORT_SIGNAL"
details?
Record<string, unknown> = {}
cause?
Error
Returns
AbortError
Overrides
Properties
cause?
readonlyoptionalcause:Error
Defined in: errors.ts:108
Original error that caused this error
Inherited from
code
readonlycode:AgentickErrorCode
Defined in: errors.ts:102
Unique error code for programmatic handling
Inherited from
details
readonlydetails:Record<string,unknown>
Defined in: errors.ts:105
Additional error details
Inherited from
Methods
fromJSON()
staticfromJSON(json):AgentickError
Defined in: errors.ts:169
Create error from serialized format
Parameters
json
Returns
Inherited from
fromSignal()
staticfromSignal(signal):AbortError
Defined in: errors.ts:207
Create from an AbortSignal's reason
Parameters
signal
AbortSignal
Returns
AbortError
timeout()
statictimeout(timeoutMs):AbortError
Defined in: errors.ts:225
Create a timeout abort error
Parameters
timeoutMs
number
Returns
AbortError
toJSON()
toJSON():
SerializedAgentickError
Defined in: errors.ts:137
Serialize error for transport (JSON-safe)