From 065e028717dcbe7b050539c4c49a95b007b2b2dc Mon Sep 17 00:00:00 2001 From: DevAndromeda <46562212+DevAndromeda@users.noreply.github.com> Date: Thu, 12 Aug 2021 16:11:33 +0545 Subject: [PATCH] fix(StreamDispatcher): forward error created by AudioPlayer.play() --- src/VoiceInterface/StreamDispatcher.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/VoiceInterface/StreamDispatcher.ts b/src/VoiceInterface/StreamDispatcher.ts index 8f72da7..644f20d 100644 --- a/src/VoiceInterface/StreamDispatcher.ts +++ b/src/VoiceInterface/StreamDispatcher.ts @@ -193,7 +193,11 @@ class StreamDispatcher extends EventEmitter { } } - this.audioPlayer.play(resource); + try { + this.audioPlayer.play(resource); + } catch(e) { + this.emit("error", e as AudioPlayerError); + } return this; }