1 2 3 4
process.on('uncaughtException', (err) => { // handle the error safely console.error(err); });