Skip to content

API ReferenceErrorsClass

SubgraphCompatibilityError

Error thrown when a LOC read gets data from the subgraph that this SDK version cannot read faithfully: the index belongs to a different deployment, or its records are incomplete or in a format this version does not support. The whole read fails rather than returning partial data. A network failure throws its own error instead.

Check that subgraphUrl points at the subgraph for the profile’s network, and that the SDK is up to date.

Extends

Constructors

Constructor

new SubgraphCompatibilityError(
reason,
message,
cause?
): SubgraphCompatibilityError;

Parameters

ParameterTypeDescription
reasonSubgraphCompatibilityReasonWhich check the indexed data failed.
messagestring-
cause?unknown-

Returns

SubgraphCompatibilityError

Overrides

BaseError.constructor

Properties

reason

readonly reason: SubgraphCompatibilityReason;

Which check the indexed data failed.

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