Infraestructure Ready to integrate API Data Fetcher to the Docs

This commit is contained in:
Luis Fernando Molina committed 2021-05-23 17:13:13 +02:00
1 parent 3764fcb274
commit aa30e40791
3 files changed
+67 -33

No files matched your search

@@ -1,7 +1,7 @@
{
"topic": "TS LF Trading Bot Errors",
"pageNumber": 53,
"type": "TS LF Trading Bot Error - Annoucement Condition Evaluation Error",
"type": "TS LF Trading Bot Error - Announcement 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
@@ -15,6 +15,23 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
function initialize(pStatusDependencies, callBackFunction) {
try {
const message = 'Announcement Condition Evaluation Error'
let err = {
message: message
}
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS LF Trading Bot Error - ' + message,
placeholder: {}
}
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, err, undefined, undefined, undefined, undefined, undefined)
err.docs = docs
err.node = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex]
throw (err)
statusDependencies = pStatusDependencies;
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
} catch (err) {
@@ -196,7 +213,7 @@ exports.newSuperalgosBotModulesFetchingProcess = function (processIndex) {
if (endpointNode === undefined) {
// TODO ERROR HANDLING.
console.log("API Endpoint counld not be found. Check that the at least one Record Property has an API Response Field Reference child, and that this one is referencing an API Response Field.")
throw("Cant continue")
throw ("Cant continue")
}
}
@@ -24,44 +24,61 @@ exports.newSuperalgosFunctionLibrariesProcessFunctions = function () {
/*
If the process is finishing with an error, we report it to the UI
and return to the process caller with a FAIL.
If the docs object was created by an inner module, we will take it and
use it, otherwise we will consider this is a process level error and
we will generate the docs object right here.
*/
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS Process Error - Unexpected Error',
placeholder: {}
}
if (error.docs !== undefined) {
if (error.message !== undefined) {
docs.placeholder.errorMessage = {
style: 'Error',
text: error.message
TS.projects.superalgos.functionLibraries.processFunctions.processError
(
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY,
error.node,
error.message,
error.docs
)
} else {
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS Process Error - Unexpected Error',
placeholder: {}
}
}
if (error.stack !== undefined) {
docs.placeholder.errorStack = {
style: 'Javascript',
text: error.stack
if (error.message !== undefined) {
docs.placeholder.errorMessage = {
style: 'Error',
text: error.message
}
}
}
if (error.code !== undefined) {
docs.placeholder.errorCode = {
if (error.stack !== undefined) {
docs.placeholder.errorStack = {
style: 'Javascript',
text: error.stack
}
}
if (error.code !== undefined) {
docs.placeholder.errorCode = {
style: 'Json',
text: error.code
}
}
docs.placeholder.errorDetails = {
style: 'Json',
text: error.code
text: JSON.stringify(error, undefined, 4)
}
}
docs.placeholder.errorDetails = {
style: 'Json',
text: JSON.stringify(error, undefined, 4)
}
TS.projects.superalgos.functionLibraries.processFunctions.processError
(
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY,
undefined,
"An unexpected error caused the Process to stop.",
docs
)
TS.projects.superalgos.functionLibraries.processFunctions.processError
(
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY,
undefined,
"An unexpected error caused the Process to stop.",
docs
)
}
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
} else {