Skip to content

RpcError

Defined in: client-sdk-js/src/rpc.ts:7

Specialized error for RPC methods.

When thrown in an RPC handler, the message and code are sent back to the caller. Built-in error codes 1001–1999 are reserved.

  • Error
new RpcError(
code,
message,
data?
): RpcError;

Defined in: client-sdk-js/src/rpc.ts:14

number

string

string

RpcError

Error.constructor

code: number;

Defined in: client-sdk-js/src/rpc.ts:11


data?: string;

Defined in: client-sdk-js/src/rpc.ts:12


message: string;

Defined in: website/node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075

Error.message


name: string;

Defined in: website/node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074

Error.name


stack?: string;

Defined in: website/node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Error.stack


static ErrorCode: object;

Defined in: client-sdk-js/src/rpc.ts:20

readonly APPLICATION_ERROR: 1500 = 1500;
readonly CONNECTION_TIMEOUT: 1501 = 1501;
readonly RECIPIENT_DISCONNECTED: 1503 = 1503;
readonly RECIPIENT_NOT_FOUND: 1401 = 1401;
readonly REQUEST_PAYLOAD_TOO_LARGE: 1402 = 1402;
readonly RESPONSE_PAYLOAD_TOO_LARGE: 1504 = 1504;
readonly RESPONSE_TIMEOUT: 1502 = 1502;
readonly SEND_FAILED: 1505 = 1505;
readonly UNSUPPORTED_METHOD: 1400 = 1400;

static ErrorMessage: Record<keyof typeof ErrorCode, string>;

Defined in: client-sdk-js/src/rpc.ts:32


static MAX_DATA_BYTES: number = 15360;

Defined in: client-sdk-js/src/rpc.ts:9


static MAX_MESSAGE_BYTES: number = 256;

Defined in: client-sdk-js/src/rpc.ts:8

static builtIn(key, data?): RpcError;

Defined in: client-sdk-js/src/rpc.ts:45

Create a built-in error by key name.

| "APPLICATION_ERROR" | "CONNECTION_TIMEOUT" | "RESPONSE_TIMEOUT" | "RECIPIENT_DISCONNECTED" | "RESPONSE_PAYLOAD_TOO_LARGE" | "SEND_FAILED" | "UNSUPPORTED_METHOD" | "RECIPIENT_NOT_FOUND" | "REQUEST_PAYLOAD_TOO_LARGE"

string

RpcError