mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
Fix loop and only emit error, not warn
This commit is contained in:
@@ -74,11 +74,11 @@ class StreamDispatcher extends Writable {
|
|||||||
* Emitted when the dispatcher encounters an error.
|
* Emitted when the dispatcher encounters an error.
|
||||||
* @event StreamDispatcher#error
|
* @event StreamDispatcher#error
|
||||||
*/
|
*/
|
||||||
this.emit(this.listenerCount('error') > 0 ? 'error' : 'warn', err);
|
if (err) this.emit('error', err);
|
||||||
this.destroy();
|
this.destroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.on('error', streamError);
|
this.on('error', () => streamError());
|
||||||
if (this.streams.input) this.streams.input.on('error', streamError);
|
if (this.streams.input) this.streams.input.on('error', streamError);
|
||||||
if (this.streams.ffmpeg) this.streams.ffmpeg.on('error', streamError);
|
if (this.streams.ffmpeg) this.streams.ffmpeg.on('error', streamError);
|
||||||
if (this.streams.opus) this.streams.opus.on('error', streamError);
|
if (this.streams.opus) this.streams.opus.on('error', streamError);
|
||||||
|
|||||||
Reference in New Issue
Block a user