Announcements Error Handling Improved

This commit is contained in:
Luis Fernando Molina committed 2021-01-27 08:54:27 +01:00
1 parent 75289cfe0d
commit b23f7015e4
4 files changed
+161 -3

No files matched your search

@@ -0,0 +1,15 @@
{
"topic": "Error Causes",
"pageNumber": "9",
"type": "Unexpected Error",
"definition": {
"text": "An Unexpected Error is an error that happened at runtime that does not have a programmed way to handle it, and it usually produces the procedure where it happens to be halted. For those errors we preserve all the information available and display it at the Docs for users to analyze them.",
"updated": 1611733132608
},
"paragraphs": [
{
"style": "Text",
"text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode. Then you can use doscs.save to save your changes and app.contribute to send it to the main repository."
}
]
}
@@ -0,0 +1,20 @@
{
"topic": "TS LF Trading Bot Errors",
"pageNumber": "52",
"type": "TS LF Trading Bot Error - Social Bots Node Missing",
"definition": {
"text": "A Social Bots Node was expected but not found at the node where the error poped up.",
"updated": 1611732443032
},
"paragraphs": [
{
"style": "Error",
"text": "Social Bots Node Missing",
"updated": 1611732472465
},
{
"style": "Success",
"text": "Add the missing node and try again."
}
]
}
@@ -0,0 +1,104 @@
{
"topic": "TS LF Trading Bot Errors",
"pageNumber": "53",
"type": "TS LF Trading Bot Error - Annoucement Condition Evaluation Error",
"definition": {
"text": "While evaluation an Announcement Condition code, the system encountered an error at the code you provided for that condition. ",
"updated": 1611733294584
},
"paragraphs": [
{
"style": "Error",
"text": "Annoucement Unexpected Error",
"updated": 1611732817870
},
{
"style": "Title",
"text": "Error Details"
},
{
"style": "Text",
"text": "In the following section you will find the specific information received when this error occured."
},
{
"style": "Note",
"text": "You will only see it if you opened this page as a result of the error actually happening."
},
{
"style": "Subtitle",
"text": "Error Message"
},
{
"style": "Text",
"text": "The following is the Error Message of the Exception that occured at the LF Trading Bot:"
},
{
"style": "Placeholder",
"text": "errorMessage"
},
{
"style": "Subtitle",
"text": "Error Stack"
},
{
"style": "Text",
"text": "The following is the Error Stack of the Exception that occured at the LF Trading Bot:"
},
{
"style": "Placeholder",
"text": "errorStack"
},
{
"style": "Subtitle",
"text": "Error Code"
},
{
"style": "Text",
"text": "The follwing is the Error Code of the Exception that occured at the LF Trading Bot:"
},
{
"style": "Placeholder",
"text": "errorCode"
},
{
"style": "Subtitle",
"text": "Error Details"
},
{
"style": "Text",
"text": "The follwing are all the Error details of the Exception that occured at the LF Trading Bot:"
},
{
"style": "Placeholder",
"text": "errorDetails"
},
{
"style": "Subtitle",
"text": "Node Name"
},
{
"style": "Text",
"text": "The follwing is the node's name of the Node most related to this error:"
},
{
"style": "Placeholder",
"text": "nodeName"
},
{
"style": "Subtitle",
"text": "Node Code"
},
{
"style": "Text",
"text": "The follwing is the code stored at the node that produced the error at the LF Trading Bot:"
},
{
"style": "Placeholder",
"text": "nodeCode"
},
{
"style": "Text",
"text": ""
}
]
}
@@ -36,7 +36,18 @@ exports.newSuperalgosBotModulesAnnouncements = function (processIndex) {
try {
conditionValue = eval(announcement.announcementCondition.code)
} catch (err) {
tradingSystem.errors.push([announcement.announcementCondition.id, err.message])
const message = 'Annoucement Condition Evaluation Error'
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS LF Trading Bot Error - ' + message,
placeholder: {}
}
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, err, announcement.announcementCondition.name, announcement.announcementCondition.code, undefined, undefined, undefined)
tradingSystem.errors.push([announcement.announcementCondition.id, err.message, docs])
}
if (conditionValue !== true) { canAnnounce = false }
}
@@ -50,10 +61,18 @@ exports.newSuperalgosBotModulesAnnouncements = function (processIndex) {
TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots.announce(text)
tradingSystem.announcements.push([announcement.id, text])
} else {
tradingSystem.errors.push([announcement.id, 'Could not announce because session does not have Social Bots.'])
const message = 'Social Bots Node Missing'
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS LF Trading Bot Error - ' + message,
placeholder: {}
}
tradingSystem.errors.push([TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.id, message, docs])
}
}
}
}
}