If an error occurs during initial TTS request, propagate the error (#1369)

* If an error occurs during initial TTS request, propagate the error

* fix missing semicolon

* fix jslint error

* add null check to r.playbackMilliseconds
This commit is contained in:
Ed Robbins
2025-10-01 00:02:51 -04:00
committed by GitHub
parent 1d6f84c2d7
commit 5acb19225b

View File

@@ -409,6 +409,9 @@ class TaskSay extends TtsTask {
});
const r = await ep.play(filename);
this.logger.debug({r}, 'Say:exec play result');
if (r.playbackSeconds == null && r.playbackMilliseconds == null && r.playbackLastOffsetPos == null) {
this._playReject(new Error('Playback failed to start'));
}
try {
// wait for playback-stop event received to confirm if the playback is successful
await this._playPromise;