Skip to content

Commit a115161

Browse files
committed
fix(AsyncQueue): catch and log callback errors (jitsi#2370)
1 parent 510b646 commit a115161

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/util/AsyncQueue.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ export default class AsyncQueue {
3434
*/
3535
clear() {
3636
for (const finishedCallback of this._taskCallbacks.values()) {
37+
try {
3738
finishedCallback(new ClearedQueueError('The queue has been cleared'));
39+
} catch (error) {
40+
logger.error('Error in callback while clearing the queue:', error);
41+
}
3842
}
3943
this._queue.kill();
4044
}

0 commit comments

Comments
 (0)