Skip to content

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

Class: WalletError<C> โ€‹

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

Base class for every typed SDK error. Subclasses set name, pin code to a literal, and may attach typed context fields.

The C parameter makes AnyWalletError a discriminated union, so if (e.code === "INSUFFICIENT_COVER") narrows to InsufficientCoverError without an instanceof chain.

Extends โ€‹

  • Error

Extended by โ€‹

Type Parameters โ€‹

Type ParameterDefault type
C extends WalletErrorCodeWalletErrorCode

Constructors โ€‹

Constructor โ€‹

ts
new WalletError<C>(
   code, 
   message, 
   options?
): WalletError<C>;

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

Parameters โ€‹

ParameterType
codeC
messagestring
options?WalletErrorOptions

Returns โ€‹

WalletError<C>

Overrides โ€‹

ts
Error.constructor

Properties โ€‹

cause? โ€‹

ts
optional cause?: unknown;

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

Inherited from โ€‹

ts
Error.cause

code โ€‹

ts
readonly code: C;

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


context โ€‹

ts
readonly context: ErrorContext;

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


message โ€‹

ts
message: string;

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

Inherited from โ€‹

ts
Error.message

name โ€‹

ts
name: string;

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

Inherited from โ€‹

ts
Error.name

stack? โ€‹

ts
optional stack?: string;

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

Inherited from โ€‹

ts
Error.stack

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

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