diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 8aa1bdc9..6a87441b 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -824,10 +824,11 @@ class TaskGather extends SttTask { if (code === 413 && error === 'Too much speech') return this._resolve('timeout'); } this.logger.info({evt}, 'TaskGather:_onJambonzError'); + const errMessage = evt.error || evt.Message; writeAlerts({ account_sid: cs.accountSid, 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, }).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}`});