This commit is contained in:
Quan HL
2024-04-10 06:11:46 +07:00
parent ee7dfbc194
commit 678fd086ea
+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);
}
}