diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/Snapshots.js b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/Snapshots.js index 1e1a4ce48..009920a40 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/Snapshots.js +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/Snapshots.js @@ -240,10 +240,11 @@ exports.newSuperalgosBotModulesSnapshots = function (processIndex) { let value = eval(instruction) values.push(value) } catch (err) { + const message = 'Snapshot Unexpected Error' let docs = { project: 'Superalgos', category: 'Topic', - type: 'TS LF Trading Bot Error - Snapshot Instruction Evaluation Error', + type: 'TS LF Trading Bot Error - ' + message, placeholder: {} } @@ -252,7 +253,7 @@ exports.newSuperalgosBotModulesSnapshots = function (processIndex) { } TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, err, nodeWithCode.name, nodeWithCode.code, undefined, undefined, contextInfo) - tradingSystem.errors.push([nodeWithCode.id, 'Instruction ' + instruction + ' evalueates with error ' + err.message]) + tradingSystem.errors.push([nodeWithCode.id, message, docs]) values.push(0) } } @@ -260,15 +261,16 @@ exports.newSuperalgosBotModulesSnapshots = function (processIndex) { } } } catch (err) { + const message = 'Snapshot Unexpected Error' let docs = { project: 'Superalgos', category: 'Topic', - type: 'TS LF Trading Bot Error - Snapshot Unexpected Error', + type: 'TS LF Trading Bot Error - ' + message, placeholder: {} } TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, err, nodeWithCode.name, nodeWithCode.code, undefined) - tradingSystem.errors.push([nodeWithCode.id, err.message, docs]) + tradingSystem.errors.push([nodeWithCode.id, message, docs]) TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[ERROR] runSimulation -> addCodeToSnapshot -> nodeWithCode.code = ' + nodeWithCode.code) TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[ERROR] runSimulation -> addCodeToSnapshot -> err = ' + err.stack) }