Skip to content

@lelantos-org/sdk / core/errors / NetworkError

Class: NetworkError<C> โ€‹

Defined in: @lelantos-org/sdk/dist/core/errors.d.ts:93

HTTP failure after retries, or deadline expired. cause carries the underlying network error.

Generic in its code so AnyWalletError can list one variant per code. A union-typed code is not assignable to { code: "RELAYER_TIMEOUT" }, so without this the Extract behind WalletErrorOf discards this class and every network code narrows to never. The parameter defaults to the full union, so NetworkError still names the class in an annotation.

Extends โ€‹

Type Parameters โ€‹

Type ParameterDefault type
C extends NetworkErrorCodeNetworkErrorCode

Constructors โ€‹

Constructor โ€‹

ts
new NetworkError<C>(
   code, 
   url, 
   message, 
   opts?
): NetworkError<C>;

Defined in: @lelantos-org/sdk/dist/core/errors.d.ts:98

Parameters โ€‹

ParameterType
codeC
urlstring
messagestring
opts?WalletErrorOptions & object

Returns โ€‹

NetworkError<C>

Overrides โ€‹

WalletError.constructor

Properties โ€‹

body? โ€‹

ts
readonly optional body?: string;

Defined in: @lelantos-org/sdk/dist/core/errors.d.ts:97

Response body of the last failed attempt, truncated.


cause? โ€‹

ts
optional cause?: unknown;

Defined in: typescript/lib/lib.es2022.error.d.ts:26

Inherited from โ€‹

WalletError.cause


code โ€‹

ts
readonly code: C;

Defined in: @lelantos-org/sdk/dist/core/errors.d.ts:42

Inherited from โ€‹

WalletError.code


context โ€‹

ts
readonly context: ErrorContext;

Defined in: @lelantos-org/sdk/dist/core/errors.d.ts:43

Inherited from โ€‹

WalletError.context


message โ€‹

ts
message: string;

Defined in: typescript/lib/lib.es5.d.ts:1077

Inherited from โ€‹

WalletError.message


name โ€‹

ts
name: string;

Defined in: typescript/lib/lib.es5.d.ts:1076

Inherited from โ€‹

WalletError.name


stack? โ€‹

ts
optional stack?: string;

Defined in: typescript/lib/lib.es5.d.ts:1078

Inherited from โ€‹

WalletError.stack


status? โ€‹

ts
readonly optional status?: number;

Defined in: @lelantos-org/sdk/dist/core/errors.d.ts:95


url โ€‹

ts
readonly url: string;

Defined in: @lelantos-org/sdk/dist/core/errors.d.ts:94

Methods โ€‹

withContext() โ€‹

ts
withContext(extra): this;

Defined in: @lelantos-org/sdk/dist/core/errors.d.ts:46

Merge additional context in place and return this for rethrowing.

Parameters โ€‹

ParameterType
extraErrorContext

Returns โ€‹

this

Inherited from โ€‹

WalletError.withContext

Lelantosno cookies ๐Ÿช ยท no tracking ๐Ÿ‘๏ธ ยท no accounts ๐Ÿ‘คwalletexplorer4536080GitHub