Handle errors during master startup

Print a message urging unhandled exceptions thrown by startup to be
reported to the GitHub issue tracker and initiate shutdown.
This commit is contained in:
Hornwitser committed 2019-08-24 11:09:01 +02:00
1 parent 7dcd46a99a
commit ed54db0db9
2 files changed
+9 -1

No files matched your search

+1
View File
@@ -3,6 +3,7 @@ Version 2.0.0
- Fixed sslCert and sslPrivKey entries being ignored in the config.
- Changed ssl key creation to be done at startup instead of on npm install.
- Added error handling during master startup.
Breaking Changes
----------------
+8 -1
View File
@@ -1042,5 +1042,12 @@ async function startServer() {
module.exports = app;
if (module === require.main) {
startServer();
startServer().catch(err => {
console.error(
"Unexpected error occured while starting master, please report\n"+
"it to https://github.com/clusterio/factorioClusterio/issues"
);
console.error(err);
return shutdown();
});
}