From 4a75dae262876e723004ad2de7d49fb45606817f Mon Sep 17 00:00:00 2001 From: Androz2091 Date: Thu, 18 Feb 2021 23:09:10 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Catch=20stream=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Player.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Player.js b/src/Player.js index 9868a55..6ae6bc4 100644 --- a/src/Player.js +++ b/src/Player.js @@ -1120,6 +1120,8 @@ class Player extends EventEmitter { }) } + newStream.on('error', (error) => this.emit('error', error, queue.firstMessage)) + setTimeout(() => { if (queue.stream) queue.stream.destroy() queue.stream = newStream