Recover from server crash

It is not only the 'uncaughtException', but every async operation like unhandled errors in EventEmitters (missing on('error',...)) and unhandled promise rejections. If any of these happen in your function node, in some cases you cannot even tell that it came from there, as the code is executed from the event loop.

As @knolleary stated, it is hard to determine, where the problem has occurred exactly. So the only reasonable thing is to let the process crash and perform an automatic restart by some process manager like pm2, nssm, etc - at least for production systems. Otherwise you could end up with inconsistent states.

2 Likes