report aws stt errors

This commit is contained in:
Dave Horton
2023-11-30 13:29:39 -05:00
parent 11283edf6f
commit 7718f50877

View File

@@ -824,10 +824,11 @@ class TaskGather extends SttTask {
if (code === 413 && error === 'Too much speech') return this._resolve('timeout'); if (code === 413 && error === 'Too much speech') return this._resolve('timeout');
} }
this.logger.info({evt}, 'TaskGather:_onJambonzError'); this.logger.info({evt}, 'TaskGather:_onJambonzError');
const errMessage = evt.error || evt.Message;
writeAlerts({ writeAlerts({
account_sid: cs.accountSid, account_sid: cs.accountSid,
alert_type: AlertType.STT_FAILURE, alert_type: AlertType.STT_FAILURE,
message: `Custom speech vendor ${this.vendor} error: ${evt.error}`, message: `Custom speech vendor ${this.vendor} error: ${errMessage}`,
vendor: this.vendor, vendor: this.vendor,
}).catch((err) => this.logger.info({err}, 'Error generating alert for jambonz custom connection failure')); }).catch((err) => this.logger.info({err}, 'Error generating alert for jambonz custom connection failure'));
this.notifyError({msg: 'ASR error', details:`Custom speech vendor ${this.vendor} error: ${evt.error}`}); this.notifyError({msg: 'ASR error', details:`Custom speech vendor ${this.vendor} error: ${evt.error}`});