I have read so far that on an uncaught exception it is best to restart the node.js server. However my concern is that for example when multiple users are using the same node.js server and an exception is thrown for one user's request the server would shutdown thus ending whatever processes was taking place for other users. An example would be when one user is in the middle of a critical transaction an uncaught exception is thrown for another user thus stopping the server and having the transaction incomplete and not rolled back somehow even.
In this case considering multiple users what is the best way/practice of handling exceptions
Regards, MilindaD
process on uncaught exception does not restart the server, it allows Node to continue execution, so the other users will continue any transaction or handling as if nothing happened. Be careful with this method, though, you may use it but the code will be in an unknown state and it will continue execution from where it threw the error.