fix: uncaughtException needs more best practices
Closed this issue · 2 comments
Add default known-recoverable uncaughtExceptions
There are no recoverable uncaught exceptions. This is clearly documented:
The event should not be used as an equivalent to On Error Resume Next. Unhandled exceptions inherently mean that an application is in an undefined state. Attempting to resume application code without properly recovering from the exception can cause additional unforeseen and unpredictable issues.
The correct use of 'uncaughtException' is to perform synchronous cleanup of allocated resources (e.g. file descriptors, handles, etc) before shutting down the process. It is not safe to resume normal operation after 'uncaughtException'.
https://nodejs.org/api/process.html#warning-using-uncaughtexception-correctly
Note:
It is not safe to resume normal operation after 'uncaughtException'.
yet this is exactly what #102 does.
Fixed by #154