Skip to content

Commit 84a37d0

Browse files
committed
fix(store): log unrecoverable job errors
Currently, we don't cleanly catch transaction timeout errors. We still don't handle them, but at least log them
1 parent 803d295 commit 84a37d0

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

packages/store/src/queue-worker.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,21 @@ function queueWorkerRun(
451451
didHandleJob: true,
452452
};
453453
})
454+
.catch((e) => {
455+
if (_compasSentryExport) {
456+
_compasSentryExport.captureException(e);
457+
}
458+
459+
logger.error({
460+
type: "job_unhandled_error",
461+
error: AppError.format(e),
462+
});
463+
464+
return {
465+
// It tried to but failed. Slow down intentionally, before reattempting the next pick up.
466+
didHandleJob: false,
467+
};
468+
})
454469
.then(({ didHandleJob }) => {
455470
if (!didHandleJob) {
456471
worker.currentPromise = setTimeout(options.pollInterval);

0 commit comments

Comments
 (0)