We're looking to use node.js for a highly dynamic project. Traditionally, we've used Java and, when faced with an unhandled exception, an error is thrown but the web application (usually) continues to serve other requests.
With node, however, the same scenario causes the process to terminate. I'd hate to think what would happen if we deployed this system to production and the whole server crashed because of an unhandled exception.
I was wondering if there are tutorials / tools / etc to help deal with the problem of dealing with exceptions. For example, is there a way to add a global last-resort-type exception that?
process.on('uncaughtException', function (err){
console.error(err)
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With