From 1b82fb8206edbd99b3ef2e63fe2837e03995db28 Mon Sep 17 00:00:00 2001 From: Matias Date: Wed, 27 Mar 2019 14:49:48 +0100 Subject: [PATCH 1/2] Normal exit process --- Run.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Run.js b/Run.js index e3d194ece..a9c441bb8 100644 --- a/Run.js +++ b/Run.js @@ -26,15 +26,7 @@ process.on('unhandledRejection', (reason, p) => { }); process.on('exit', function (code) { - try { - console.log('[INFO] Run -> process.on.exit -> About to exit -> code = ' + code); - throw new Error() - } - catch (err) { - console.log("[ERROR] Run -> process.on.exit -> Error Logging Error Code."); - console.log("[ERROR] Run -> process.on.exit -> err.message = " + err.message); - return; - } + console.log('[INFO] Run -> process.on.exit -> About to exit -> code = ' + code); }); readExecutionConfiguration(); From c01d5beed0834eea091c070336d229ea2b3a408d Mon Sep 17 00:00:00 2001 From: Matias Date: Wed, 27 Mar 2019 20:16:16 +0100 Subject: [PATCH 2/2] Exiting Process change --- Run.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Run.js b/Run.js index a9c441bb8..59cefc5fa 100644 --- a/Run.js +++ b/Run.js @@ -16,13 +16,13 @@ global.MARKET = { process.on('uncaughtException', function (err) { console.log('[INFO] Run -> uncaughtException -> err.message = ' + err.message); console.log('[INFO] Run -> uncaughtException -> err.stack = ', err.stack); - throw new Error() + process.exit(1) }); process.on('unhandledRejection', (reason, p) => { - console.log('[INFO] Run -> unhandledRejection -> reason = ' + reason); + console.log('[INFO] Run -> unhandledRejection -> reason = ' + JSON.stringify(reason)); console.log('[INFO] Run -> unhandledRejection -> p = ' + JSON.stringify(p)); - throw new Error() + process.exit(1) }); process.on('exit', function (code) {