API ReferenceErrorsClass
UserRejectedRequestError
Error for a request the user declined in their wallet, such as a transaction or signature prompt. Treat it as the user’s choice rather than a fault to report.
Inside a WalletOperationWorkflow it does not throw: the
step is marked Failed with validationErrorResponse { root: ['RejectedByUser'] }.
Extends
Constructors
Constructor
new UserRejectedRequestError(message, cause?): UserRejectedRequestError;Parameters
| Parameter | Type |
|---|---|
message | string |
cause? | unknown |
Returns
UserRejectedRequestError
Overrides
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