API ReferenceErrorsClass
ContactSupportError
Error for a failure the SDK cannot explain, such as an unexpected error inside a validation rule.
Its message asks the user to contact support and quote code. The original error, when there is
one, is its cause.
Extends
Constructors
Constructor
new ContactSupportError(code, cause?): ContactSupportError;Parameters
| Parameter | Type | Description |
|---|---|---|
code | string | Identifies where the failure happened, for support. |
cause? | unknown | - |
Returns
ContactSupportError
Overrides
Properties
code
readonly code: string;Identifies where the failure happened, for support.
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