Skip to content

Documentation / @agentick/shared / TransportError

Class: TransportError

Defined in: errors.ts:450

Error thrown for network/transport failures.

Example

typescript
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

AgentickError.constructor

Properties

cause?

readonly optional cause: Error

Defined in: errors.ts:108

Original error that caused this error

Inherited from

AgentickError.cause


code

readonly code: AgentickErrorCode

Defined in: errors.ts:102

Unique error code for programmatic handling

Inherited from

AgentickError.code


details

readonly details: Record<string, unknown>

Defined in: errors.ts:105

Additional error details

Inherited from

AgentickError.details


statusCode?

readonly optional statusCode: number

Defined in: errors.ts:455

HTTP status code if applicable


transportCode

readonly transportCode: "timeout" | "connection" | "response" | "parse"

Defined in: errors.ts:452

Type of transport error

Methods

connection()

static connection(message, url?, cause?): TransportError

Defined in: errors.ts:500

Create a connection error

Parameters

message

string

url?

string

cause?

Error

Returns

TransportError


fromJSON()

static fromJSON(json): AgentickError

Defined in: errors.ts:169

Create error from serialized format

Parameters

json

SerializedAgentickError

Returns

AgentickError

Inherited from

AgentickError.fromJSON


http()

static http(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()

static timeout(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)

Returns

SerializedAgentickError

Inherited from

AgentickError.toJSON

Released under the ISC License.