From 678fd086eac6e2408b67a077d27c652f260c31eb Mon Sep 17 00:00:00 2001 From: Quan HL Date: Wed, 10 Apr 2024 06:11:46 +0700 Subject: [PATCH] wip --- lib/routes/api/speech-credentials.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/routes/api/speech-credentials.js b/lib/routes/api/speech-credentials.js index 9b0f921..7dcd1a1 100644 --- a/lib/routes/api/speech-credentials.js +++ b/lib/routes/api/speech-credentials.js @@ -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); } }