diff --git a/packages/smart-wallet/src/smartWallet.js b/packages/smart-wallet/src/smartWallet.js index 48cfebbde60..5e6690aaef7 100644 --- a/packages/smart-wallet/src/smartWallet.js +++ b/packages/smart-wallet/src/smartWallet.js @@ -1002,19 +1002,19 @@ export const prepareSmartWallet = (baggage, shared) => { // await so that any errors are caught and handled below await watchOfferOutcomes(watcher, seatRef); - } catch (err) { + } catch (reason) { // This block only runs if the block above fails during one vat incarnation. - facets.helper.logWalletError('IMMEDIATE OFFER ERROR:', err); + facets.helper.logWalletError('IMMEDIATE OFFER ERROR:', reason); // Update status to observers - if (err.upgradeMessage === 'vat upgraded') { + if (isUpgradeDisconnection(reason)) { // The offer watchers will reconnect. Don't reclaim or exit return; } else if (watcher) { // The watcher's onRejected will updateStatus() } else { facets.helper.updateStatus({ - error: err.toString(), + error: reason.toString(), ...offerSpec, }); } @@ -1033,7 +1033,7 @@ export const prepareSmartWallet = (baggage, shared) => { // XXX tests rely on throwing immediate errors, not covering the // error handling in the event the failure is after an upgrade - throw err; + throw reason; } }, /**