function processStopped() standarized

This commit is contained in:
Luis Fernando Molina committed 2021-01-18 10:07:50 +01:00
1 parent ef394fdbb5
commit 8d29849bdc
4 files changed
+34 -5

No files matched your search

@@ -551,7 +551,17 @@
function processStopped() {
if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) {
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.")
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.",
{
project: 'Superalgos',
category: 'Topic',
type: 'TS Process Error - Unexpected Error'
}
)
} else {
TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, 'Stopped')
}
@@ -681,7 +681,17 @@
function processStopped() {
if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) {
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.")
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.",
{
project: 'Superalgos',
category: 'Topic',
type: 'TS Process Error - Unexpected Error'
}
)
} else {
TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, 'Stopped')
}
@@ -10,7 +10,15 @@ exports.newSuperalgosFunctionLibrariesNodeJSFunctions = function () {
function exitProcess() {
if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) {
TS.projects.superalgos.functionLibraries.taskFunctions.taskError(undefined, "An unexpected error caused the Task to stop. " + TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE)
TS.projects.superalgos.functionLibraries.taskFunctions.taskError(
undefined,
"An unexpected error caused the Task to stop. " + TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE,
{
project: 'Superalgos',
category: 'Topic',
type: 'TS Task Error - Unexpected Error'
}
)
}
if (isNodeJsProcessShuttingDown === true) { return }
@@ -7,14 +7,15 @@ exports.newSuperalgosFunctionLibrariesTaskFunctions = function () {
return thisObject
function taskError(node, errorMessage) {
function taskError(node, errorMessage, docs) {
let event
if (node !== undefined) {
event = {
nodeName: node.name,
nodeType: node.type,
nodeId: node.id,
errorMessage: errorMessage
errorMessage: errorMessage,
docs: docs
}
} else {
event = {