Skip to content

API ReferenceErrorsClass

ProviderConnectionError

Error thrown when the SDK cannot reach the RPC provider: a read, a chain or ENS lookup, or a validation rule could not finish because the connection failed. It is usually temporary, so the same call can succeed later. ReadTimeoutError extends it for a read that ran past its deadline.

When the connection fails while the wallet is sending a transaction, the transaction may still land. Check the wallet’s activity before sending it again.

Extends

Extended by

  • ReadTimeoutError

Constructors

Constructor

new ProviderConnectionError(message?, cause?): ProviderConnectionError;

Parameters

ParameterType
messagestring
cause?unknown

Returns

ProviderConnectionError

Overrides

BaseError.constructor

Methods

walk()

walk<T>(errorType): T | undefined;

Finds an error of the given class in this error’s cause chain. The search starts with this error itself, then follows each cause in turn.

Type Parameters

Type ParameterDescription
T extends ErrorThe error class being searched for.

Parameters

ParameterTypeDescription
errorType(…args) => TThe error class to find, such as UserRejectedRequestError.

Returns

T | undefined

The first error in the chain that is an instance of errorType, or undefined if there is none.

Example

const rejected = error.walk(UserRejectedRequestError);
if (rejected) return; // the user declined in their wallet

Inherited from

BaseError.walk