Skip to content

Commit

Permalink
feat: catch all exceptions in auction wakers (#8438)
Browse files Browse the repository at this point in the history
* feat: catch all exceptions in auction wakers

existing tests pass. No new tests added, as inducing appropriate errors was too hard.

* chore: canonicalize error logs

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
Chris-Hibbert and mergify[bot] authored Oct 8, 2023
1 parent a1dd248 commit d4b32f1
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.error(`⚠️ 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.error(`⚠️ Auction threw ${e}. Caught in SchedulerWaker.`);
}
},
}),
);
Expand Down

0 comments on commit d4b32f1

Please sign in to comment.