Crash prevention

This commit is contained in:
bingus_violet 2024-06-20 23:14:26 -05:00
parent c2fb7daf20
commit a840f6ded3

View file

@ -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}`,
);
});