Documentation / @agentick/shared / TransportError
Class: TransportError
Defined in: errors.ts:450
Error thrown for network/transport failures.
Example
throw new TransportError('timeout', 'Request timed out after 30000ms');
throw new TransportError('connection', 'SSE connection error');
throw new TransportError('response', 'No response body');Extends
Constructors
Constructor
new TransportError(
transportCode,message,options?,cause?):TransportError
Defined in: errors.ts:457
Parameters
transportCode
"timeout" | "connection" | "response" | "parse"
message
string
options?
method?
string
statusCode?
number
url?
string
cause?
Error
Returns
TransportError
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
statusCode?
readonlyoptionalstatusCode:number
Defined in: errors.ts:455
HTTP status code if applicable
transportCode
readonlytransportCode:"timeout"|"connection"|"response"|"parse"
Defined in: errors.ts:452
Type of transport error
Methods
connection()
staticconnection(message,url?,cause?):TransportError
Defined in: errors.ts:500
Create a connection error
Parameters
message
string
url?
string
cause?
Error
Returns
TransportError
fromJSON()
staticfromJSON(json):AgentickError
Defined in: errors.ts:169
Create error from serialized format
Parameters
json
Returns
Inherited from
http()
statichttp(statusCode,url,message?):TransportError
Defined in: errors.ts:507
Create an HTTP error (non-2xx response)
Parameters
statusCode
number
url
string
message?
string
Returns
TransportError
timeout()
statictimeout(timeoutMs,url?):TransportError
Defined in: errors.ts:493
Create a timeout error
Parameters
timeoutMs
number
url?
string
Returns
TransportError
toJSON()
toJSON():
SerializedAgentickError
Defined in: errors.ts:137
Serialize error for transport (JSON-safe)