mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-22 01:27:55 +00:00
add more error logs
This commit is contained in:
@@ -68,17 +68,17 @@ class Cognigy extends Task {
|
|||||||
rejector = reject;
|
rejector = reject;
|
||||||
});
|
});
|
||||||
this.taskQueue.push(async(cb) => {
|
this.taskQueue.push(async(cb) => {
|
||||||
this.logger.info("EXECUTING SAY TASK");
|
this.logger.info('EXECUTING SAY TASK');
|
||||||
try {
|
try {
|
||||||
const result = await task();
|
const result = await task();
|
||||||
resolver(result);
|
resolver(result);
|
||||||
cb(result);
|
cb(result);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.logger.error({err}, "could not execute task in task queue");
|
this.logger.error({err}, 'could not execute task in task queue');
|
||||||
rejector(err);
|
rejector(err);
|
||||||
cb(err);
|
cb(err);
|
||||||
}
|
}
|
||||||
this.logger.info("SAY TASK EXECUTED");
|
this.logger.info('SAY TASK EXECUTED');
|
||||||
});
|
});
|
||||||
this.taskQueue.lastPromise = taskPromise;
|
this.taskQueue.lastPromise = taskPromise;
|
||||||
return taskPromise;
|
return taskPromise;
|
||||||
@@ -154,8 +154,13 @@ class Cognigy extends Task {
|
|||||||
this.client.removeAllListeners();
|
this.client.removeAllListeners();
|
||||||
if (this.client && this.client.connected) this.client.disconnect();
|
if (this.client && this.client.connected) this.client.disconnect();
|
||||||
|
|
||||||
// end the task queue AFTER we have removed all listeneres since now we cannot get new stuff inside the queue
|
try {
|
||||||
this.taskQueue.end();
|
// end the task queue AFTER we have removed all listeneres since now we cannot get new stuff inside the queue
|
||||||
|
this.taskQueue.end();
|
||||||
|
} catch (err) {
|
||||||
|
this.logger.error({err}, 'could not end tasks queue!!');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!this.hasReportedFinalAction) {
|
if (!this.hasReportedFinalAction) {
|
||||||
this.reportedFinalAction = true;
|
this.reportedFinalAction = true;
|
||||||
@@ -229,7 +234,7 @@ class Cognigy extends Task {
|
|||||||
async _onBotFinalPing(cs, ep) {
|
async _onBotFinalPing(cs, ep) {
|
||||||
this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing');
|
this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing');
|
||||||
await this.taskQueue.lastPromise;
|
await this.taskQueue.lastPromise;
|
||||||
this.gatherTask = this._makeGatherTask({textPrompt: "this should be changed"});
|
this.gatherTask = this._makeGatherTask({textPrompt: 'this should be changed'});
|
||||||
this.gatherTask.exec(cs, ep, this)
|
this.gatherTask.exec(cs, ep, this)
|
||||||
.catch((err) => this.logger.info({err}, 'Cognigy gather task returned error'));
|
.catch((err) => this.logger.info({err}, 'Cognigy gather task returned error'));
|
||||||
this.prompts = [];
|
this.prompts = [];
|
||||||
@@ -258,9 +263,9 @@ class Cognigy extends Task {
|
|||||||
if (text) {
|
if (text) {
|
||||||
|
|
||||||
await this._enqueueTask((async() => {
|
await this._enqueueTask((async() => {
|
||||||
this.logger.info({text}, "received text");
|
this.logger.info({text}, 'received text');
|
||||||
const sayTask = this._makeSayTask(text);
|
const sayTask = this._makeSayTask(text);
|
||||||
await sayTask.exec(cs, ep, this);
|
await sayTask.exec(cs, ep, this);
|
||||||
}).bind(this));
|
}).bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user