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
| Parameter | Type | Description |
|---|---|---|
reason | SubgraphCompatibilityReason | Which check the indexed data failed. |
message | string | - |
cause? | unknown | - |
Returns
SubgraphCompatibilityError
Overrides
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 Parameter | Description |
|---|---|
T extends Error | The error class being searched for. |
Parameters
| Parameter | Type | Description |
|---|---|---|
errorType | (…args) => T | The 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