From a1151618eb2bf712267c48c042687b3079820125 Mon Sep 17 00:00:00 2001 From: Auxane Date: Mon, 16 Oct 2023 08:58:37 +0200 Subject: [PATCH] fix(AsyncQueue): catch and log callback errors (#2370) --- modules/util/AsyncQueue.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/util/AsyncQueue.js b/modules/util/AsyncQueue.js index 60b19962cb..b516cef4b5 100644 --- a/modules/util/AsyncQueue.js +++ b/modules/util/AsyncQueue.js @@ -34,7 +34,11 @@ export default class AsyncQueue { */ clear() { for (const finishedCallback of this._taskCallbacks.values()) { + try { finishedCallback(new ClearedQueueError('The queue has been cleared')); + } catch (error) { + logger.error('Error in callback while clearing the queue:', error); + } } this._queue.kill(); }