From 0ff6e43075c7ce09a9aa811b70ce3206d27afa78 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 17 Oct 2019 22:19:30 +0200 Subject: [PATCH] Better handling bad timePerdiod definition --- MultiPeriod.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MultiPeriod.js b/MultiPeriod.js index d4e8325bc..bbbbf4dfb 100644 --- a/MultiPeriod.js +++ b/MultiPeriod.js @@ -827,8 +827,12 @@ n = 0; - callTheBot(); - + if (currentTimePeriod !== undefined) { + callTheBot(); + } else { + logger.write(MODULE_NAME, "[ERROR] start -> processTimePeriodsDailyFiles -> periodsControlLoop -> Time Period not Recognized. Can not continue." ); + callBackFunction(global.DEFAULT_FAIL_RESPONSE); + } } } catch (err) { @@ -842,7 +846,7 @@ try { if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> processTimePeriodsDailyFiles -> callTheBot -> Entering function."); } - + usertBot.start( multiPeriodDataFiles, currentTimePeriod,