Allow Say, Gather, Transcribe is able to finished if there is error for speech credential (#910)

* allow move to next task if say verb is failed because of speech credential

* allow move to next task if say verb is failed because of speech credential

* allow move to next task if say verb is failed because of speech credential

* wip

* wip
This commit is contained in:
Hoan Luu Huu
2024-10-02 00:40:41 +07:00
committed by GitHub
parent b898b70520
commit 96b3b0fe07
6 changed files with 65 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ const Task = require('./task');
const assert = require('assert');
const crypto = require('crypto');
const { TaskPreconditions, CobaltTranscriptionEvents } = require('../utils/constants');
const { SpeechCredentialError } = require('../utils/error');
class SttTask extends Task {
@@ -190,7 +191,7 @@ class SttTask extends Task {
target_sid: cs.callSid
}).catch((err) => this.logger.info({err}, 'Error generating alert for no stt'));
// the ASR might have fallback configuration, should not done task here.
throw new Error(`No speech-to-text service credentials for ${vendor} have been configured`);
throw new SpeechCredentialError(`No speech-to-text service credentials for ${vendor} have been configured`);
}
if (vendor === 'nuance' && credentials.client_id) {