Skip to content

Commit

Permalink
fix: let the caller handle dispatch rejections
Browse files Browse the repository at this point in the history
We don't crash the doProcess call because technically, it has
succeeded (just resulted in a rejection), so reserve a rejection
for when the liveSlots mechanism actually fails.
  • Loading branch information
michaelfig committed Mar 19, 2020
1 parent b88b207 commit 8a9761d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/SwingSet/src/kernel/liveSlots.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,16 @@ function build(syscall, _state, makeRoot, forVatID) {
if (result) {
lsdebug(` ls.deliver attaching then ->${result}`);
insistVatType('promise', result);

// We return the results of the resolve/reject, rather
// than rejecting the dispatch with whatever the method
// did.
// It is up to the caller to handle or fail to handle the
// rejection. Failing to handle should trigger a platform
// log, rather than via our parent doProcess call.

// eslint-disable-next-line no-use-before-define
p.then(thenResolve(result), thenReject(result));
return p.then(thenResolve(result), thenReject(result));
}
return p;
}
Expand Down

0 comments on commit 8a9761d

Please sign in to comment.