check playht can fetch voices when adding new speech credential (#309)

* check playht can fetch voices when adding new speech credential

* wip

* wip

* wip

* wip
This commit is contained in:
Hoan Luu Huu authored and GitHub committed 2024-04-12 07:01:13 -04:00
1 parent b21d10eb3e
commit 80418aa7e5
2 files changed
+23 -3

No files matched your search

+6 -1
View File
@@ -743,7 +743,12 @@ router.get('/:sid/test', async(req, res) => {
results.tts.status = 'ok';
SpeechCredential.ttsTestResult(sid, true);
} catch (err) {
results.tts = {status: 'fail', reason: err.message};
let reason = err.message;
// if error is from bent, let get the body
try {
reason = await err.text();
} catch {}
results.tts = {status: 'fail', reason};
SpeechCredential.ttsTestResult(sid, false);
}
}