mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
wip
This commit is contained in:
@@ -163,6 +163,7 @@ class TaskSay extends Task {
|
||||
executedLanguage = language;
|
||||
|
||||
} catch (error) {
|
||||
let isFallbackSuccess = false;
|
||||
if (fallbackVendor) {
|
||||
const fallbackcredentials = cs.getSpeechCredentials(fallbackVendor, 'tts', fallbackLabel);
|
||||
const {span: fallbackSpan} = this.startChildSpan('fallback-tts-generation', {
|
||||
@@ -184,6 +185,7 @@ class TaskSay extends Task {
|
||||
credentials: fallbackcredentials,
|
||||
disableTtsCache : this.disableTtsCache
|
||||
});
|
||||
isFallbackSuccess = true;
|
||||
|
||||
fallbackSpan.setAttributes({'tts.cached': servedFromCache});
|
||||
fallbackSpan.end();
|
||||
@@ -211,17 +213,18 @@ class TaskSay extends Task {
|
||||
}).catch((err) => this.logger.info({err}, 'Error generating alert for fallback tts failure'));
|
||||
}
|
||||
}
|
||||
|
||||
this.logger.info({error}, 'Error synthesizing tts');
|
||||
span.end();
|
||||
writeAlerts({
|
||||
account_sid: cs.accountSid,
|
||||
alert_type: AlertType.TTS_FAILURE,
|
||||
vendor,
|
||||
detail: error.message
|
||||
}).catch((err) => this.logger.info({err}, 'Error generating alert for tts failure'));
|
||||
this.notifyError({msg: 'TTS error', details: error.message || error});
|
||||
return;
|
||||
if (!isFallbackSuccess) {
|
||||
this.logger.info({error}, 'Error synthesizing tts');
|
||||
span.end();
|
||||
writeAlerts({
|
||||
account_sid: cs.accountSid,
|
||||
alert_type: AlertType.TTS_FAILURE,
|
||||
vendor,
|
||||
detail: error.message
|
||||
}).catch((err) => this.logger.info({err}, 'Error generating alert for tts failure'));
|
||||
this.notifyError({msg: 'TTS error', details: error.message || error});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.logger.debug(`file ${filePathUrl}, served from cache ${isFromCache}`);
|
||||
|
||||
Reference in New Issue
Block a user