Skip to content

Class: ProviderRpcError

Defined in: support/wallet-common/lib/errors/eip1193Errors.ts:42

Generic provider RPC error, parent class of specialized classes (one per error code).

The subclasses exist as a convenience when throwing, but should be relied on for detection — use the code field instead.

Extends

  • HappyRpcError

Extended by

Constructors

Constructor

new ProviderRpcError(args: Omit<HappyRpcErrorArgs, "shortMessage"> & {
  code: EIP1193ErrorCodes;
}): ProviderRpcError;

Defined in: support/wallet-common/lib/errors/eip1193Errors.ts:43

Parameters

args

Omit<HappyRpcErrorArgs, "shortMessage"> & { code: EIP1193ErrorCodes; }

Returns

ProviderRpcError

Overrides

HappyRpcError.constructor

Methods

toString()

toString(): string;

Defined in: support/wallet-common/lib/errors/HappyRpcError.ts:53

Returns a string representation of an object.

Returns

string

Inherited from

HappyRpcError.toString

Properties

cause?

readonly optional cause: unknown;

Defined in: support/wallet-common/lib/errors/HappyRpcError.ts:40

The thing that caused this to be thrown (or a string representation of it in case the error was inflated from serialized form).

Inherited from

HappyRpcError.cause

code

readonly code: 
  | 3
  | EIP1193ErrorCodes
  | EIP1474ErrorCodes;

Defined in: support/wallet-common/lib/errors/HappyRpcError.ts:22

Standard RPC error code from EIP1193ErrorCodes or EIP1474ErrorCodes

Inherited from

HappyRpcError.code

ctxMessages?

readonly optional ctxMessages: string[];

Defined in: support/wallet-common/lib/errors/HappyRpcError.ts:34

This can store extra contextual information, similar to Viem's metaMessages. We used it to include the RPC URL and the request body, just as Viem would do for its own errors.

Inherited from

HappyRpcError.ctxMessages

details?

readonly optional details: string;

Defined in: support/wallet-common/lib/errors/HappyRpcError.ts:28

Additional details provided when throwing the error.

Inherited from

HappyRpcError.details

shortMessage

readonly shortMessage: string;

Defined in: support/wallet-common/lib/errors/HappyRpcError.ts:25

Short message matching the error code.

Inherited from

HappyRpcError.shortMessage