All logging issues fixed.

This commit is contained in:
Luis Fernando Molina committed 2018-06-04 13:02:42 +02:00
1 parent 6b60bd9806
commit 78e5c19614
3 files changed
+78 -78

No files matched your search

+26 -26
View File
@@ -497,38 +497,38 @@
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
return;
}
}
let fileName = "this.config.json";
let fileName = "this.config.json";
cloudStorage.getTextFile(filePath, fileName, onFileReceived);
cloudStorage.getTextFile(filePath, fileName, onFileReceived);
function onFileReceived(err, text) {
function onFileReceived(err, text) {
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
logger.write("[ERROR] run -> loopControl -> shallWeStop -> onFileReceived -> err.message = " + err.message);
bot.eventHandler.raiseEvent("Close Log File");
clearInterval(intervalHandle);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
return;
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
logger.write("[ERROR] run -> loopControl -> shallWeStop -> onFileReceived -> err.message = " + err.message);
bot.eventHandler.raiseEvent("Close Log File");
clearInterval(intervalHandle);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
return;
}
try {
let configRead = JSON.parse(text);
if (configRead.stopGracefully === false && global.SHALL_BOT_STOP === false) {
continueCallBack();
} else {
stopCallBack();
}
try {
let configRead = JSON.parse(text);
if (configRead.stopGracefully === false && global.SHALL_BOT_STOP === false) {
continueCallBack();
} else {
stopCallBack();
}
} catch (err) {
logger.write("[ERROR] run -> loopControl -> shallWeStop -> onFileReceived -> err.message = " + err.message);
bot.eventHandler.raiseEvent("Close Log File");
clearInterval(intervalHandle);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
return;
}
} catch (err) {
logger.write("[ERROR] run -> loopControl -> shallWeStop -> onFileReceived -> err.message = " + err.message);
bot.eventHandler.raiseEvent("Close Log File");
clearInterval(intervalHandle);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
return;
}
}
}