Skip to content

Commit

Permalink
refactor(smart-wallet): test UpgradeDisconnection correctly (#9012)
Browse files Browse the repository at this point in the history
  • Loading branch information
erights authored Feb 29, 2024
1 parent 111247f commit 1fe256a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/smart-wallet/src/smartWallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
Expand All @@ -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;
}
},
/**
Expand Down

0 comments on commit 1fe256a

Please sign in to comment.