1
0
Fork 0
forked from svrjs/svrjs

Server crashes now results in exit code of 1 if errno is not specified.

This commit is contained in:
Dorian Niemiec 2024-08-25 16:29:37 +02:00
parent f58233a014
commit 09ef59832f

6
svr.js
View file

@ -5859,7 +5859,7 @@ if (cluster.isPrimary || cluster.isPrimary === undefined) {
serverconsole.locerrmessage("SVR.JS worker just crashed!!!");
serverconsole.locerrmessage("Stack:");
serverconsole.locerrmessage(err.stack ? generateErrorStack(err) : String(err));
process.exit(err.errno);
process.exit(err.errno !== undefined ? err.errno : 1);
}
process.on("uncaughtException", crashHandlerMaster);
@ -5923,7 +5923,7 @@ if (cluster.isPrimary || cluster.isPrimary === undefined) {
serverconsole.locerrmessage("SVR.JS worker just crashed!!!");
serverconsole.locerrmessage("Stack:");
serverconsole.locerrmessage(err.stack ? generateErrorStack(err) : String(err));
process.exit(err.errno);
process.exit(err.errno !== undefined ? err.errno : 1);
}
process.on("uncaughtException", crashHandler);
@ -5947,6 +5947,6 @@ try {
serverconsole.locerrmessage("Stack:");
serverconsole.locerrmessage(generateErrorStack(err));
setTimeout(function () {
process.exit(err.errno ? err.errno : 1);
process.exit(err.errno !== undefined ? err.errno : 1);
}, 10);
}