Skip to content

Commit

Permalink
feat: catch all exceptions in auction wakers
Browse files Browse the repository at this point in the history
existing tests pass. No new tests added, as inducing appropriate errors was too hard.
  • Loading branch information
Chris-Hibbert committed Oct 5, 2023
1 parent b9a5cb4 commit b30d7c9
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions packages/inter-protocol/src/auction/scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,13 @@ export const makeScheduler = async (
liveSchedule.clockStep,
Far('PriceStepWaker', {
wake(time) {
setTimeMonotonically(time);
trace('wake step', now);
void clockTick(liveSchedule);
try {
setTimeMonotonically(time);
trace('wake step', now);
clockTick(liveSchedule);
} catch (e) {
console.warn(`🧯Auction threw ${e}. Caught in PriceStepWaker.`);
}
},
}),
stepCancelToken,
Expand All @@ -238,10 +242,14 @@ export const makeScheduler = async (
start,
Far('SchedulerWaker', {
wake(time) {
setTimeMonotonically(time);
auctionDriver.capturePrices();
// eslint-disable-next-line no-use-before-define
return startAuction();
try {
setTimeMonotonically(time);
auctionDriver.capturePrices();
// eslint-disable-next-line no-use-before-define
return startAuction();
} catch (e) {
console.warn(`🧯Auction threw ${e}. Caught in SchedulerWaker.`);
}
},
}),
);
Expand Down

0 comments on commit b30d7c9

Please sign in to comment.