Thrown when the payer failed to sign the x402 fee payment for an
operation — not when the operation itself failed.
Paying is a step of its own, taken before the paid-for request is sent.
When it fails, nothing was created: no account record, no transaction
proposal. Starting the operation again is a clean retry.
Whatever the payer threw is kept as cause. With
Salt.accountAsPayer, that is an error from the paying account's
own signing ceremony — e.g. a RoboStatusError for the paying
account's robos, or a PolicyBreachError from its policies — which
would otherwise be indistinguishable from the same failure in the
operation being paid for.
Example: Telling a failed payment apart from a failed operation
try { constceremony = awaitsalt.createAccount({ ...params, payer }); awaitceremony.wait(); } catch (err) { if (errinstanceofPaymentAuthorisationError) { // The fee was never paid and no account was created. console.error(`Payer ${err.payer} could not sign:`, err.cause); if (err.causeinstanceofRoboStatusError) { // The paying account's robos are offline, not the new account's. } } else { throwerr; } }
Thrown when the
payerfailed to sign the x402 fee payment for an operation — not when the operation itself failed.Paying is a step of its own, taken before the paid-for request is sent. When it fails, nothing was created: no account record, no transaction proposal. Starting the operation again is a clean retry.
Whatever the payer threw is kept as
cause. With Salt.accountAsPayer, that is an error from the paying account's own signing ceremony — e.g. a RoboStatusError for the paying account's robos, or a PolicyBreachError from its policies — which would otherwise be indistinguishable from the same failure in the operation being paid for.Example: Telling a failed payment apart from a failed operation