Crash prevention
This commit is contained in:
parent
c2fb7daf20
commit
a840f6ded3
1 changed files with 9 additions and 1 deletions
10
index.js
10
index.js
|
@ -170,4 +170,12 @@ wsServer.on("connection", function connection(socket) {
|
|||
|
||||
server.listen(PORT, function () {
|
||||
console.log("API & Websocket now on port: " + PORT)
|
||||
})
|
||||
})
|
||||
|
||||
process.on('uncaughtException', (err, origin) => {
|
||||
fs.writeSync(
|
||||
process.stderr.fd,
|
||||
`Caught exception: ${err}\n` +
|
||||
`Exception origin: ${origin}`,
|
||||
);
|
||||
});
|
Loading…
Reference in a new issue