From 1f043d774a712573323dd58b37ae48f536277896 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Mon, 26 Aug 2024 06:35:25 +0200 Subject: [PATCH] Replace code invoke the start() function with one with error handler --- src/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 4d2c19d..ee9deee 100644 --- a/src/index.js +++ b/src/index.js @@ -2253,4 +2253,14 @@ if (cluster.isPrimary || cluster.isPrimary === undefined) { }); } -start(true); +// Start SVR.JS! +try { + start(true); +} catch (err) { + serverconsole.locerrmessage("There was a problem starting SVR.JS!!!"); + serverconsole.locerrmessage("Stack:"); + serverconsole.locerrmessage(generateErrorStack(err)); + setTimeout(function () { + process.exit(err.errno !== undefined ? err.errno : 1); + }, 10); +} \ No newline at end of file