mirror of
https://github.com/danbulant/discord.js
synced 2026-06-07 16:52:16 +00:00
Fix loop and only emit error, not warn
This commit is contained in:
parent
6a523ba96a
commit
2531065bbd
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue