mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
Co-authored-by: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com>
This commit is contained in:
@@ -123,10 +123,18 @@ class SttTask extends Task {
|
|||||||
this.sttCredentials = await this._initSpeechCredentials(this.cs, this.vendor, this.label);
|
this.sttCredentials = await this._initSpeechCredentials(this.cs, this.vendor, this.label);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (this.canFallback) {
|
if (this.canFallback) {
|
||||||
|
this.notifyError(
|
||||||
|
{
|
||||||
|
msg: 'ASR error', details:`Invalid vendor ${this.vendor}, Error: ${error}`,
|
||||||
|
failover: 'in progress'
|
||||||
|
});
|
||||||
await this._initFallback();
|
await this._initFallback();
|
||||||
this.notifyError({ msg: 'ASR error', details:`Invalid vendor ${this.vendor}`, failover: 'in progress'});
|
|
||||||
} else {
|
} else {
|
||||||
this.notifyError({ msg: 'ASR error', details:`Invalid vendor ${this.vendor}`, failover: 'not available'});
|
this.notifyError(
|
||||||
|
{
|
||||||
|
msg: 'ASR error', details:`Invalid vendor ${this.vendor}, Error: ${error}`,
|
||||||
|
failover: 'not available'
|
||||||
|
});
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -169,11 +177,6 @@ class SttTask extends Task {
|
|||||||
alert_type: AlertType.STT_NOT_PROVISIONED,
|
alert_type: AlertType.STT_NOT_PROVISIONED,
|
||||||
vendor
|
vendor
|
||||||
}).catch((err) => this.logger.info({err}, 'Error generating alert for no stt'));
|
}).catch((err) => this.logger.info({err}, 'Error generating alert for no stt'));
|
||||||
// Notify application that STT vender is wrong.
|
|
||||||
this.notifyError({
|
|
||||||
msg: 'ASR error',
|
|
||||||
details: `No speech-to-text service credentials for ${vendor} have been configured`
|
|
||||||
});
|
|
||||||
this.notifyTaskDone();
|
this.notifyTaskDone();
|
||||||
throw new Error(`No speech-to-text service credentials for ${vendor} have been configured`);
|
throw new Error(`No speech-to-text service credentials for ${vendor} have been configured`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user