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(); }