Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Using uncaughtException is a very bad idea.</strong> </p> <p>The best alternative is to use domains in Node.js 0.8. If you're on an earlier version of Node.js rather use <a href="https://github.com/nodejitsu/forever" rel="noreferrer">forever</a> to restart your processes or even better use <a href="http://nodejs.org/api/cluster.html" rel="noreferrer">node cluster</a> to spawn multiple worker processes and restart a worker on the event of an uncaughtException.</p> <p>From: <a href="http://nodejs.org/api/process.html#process_event_uncaughtexception" rel="noreferrer">http://nodejs.org/api/process.html#process_event_uncaughtexception</a></p> <blockquote> <p><strong>Warning: Using 'uncaughtException' correctly</strong></p> <p>Note that 'uncaughtException' is a crude mechanism for exception handling intended to be used only as a last resort. 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.</p> <p>Exceptions thrown from within the event handler will not be caught. Instead the process will exit with a non-zero exit code and the stack trace will be printed. This is to avoid infinite recursion.</p> <p>Attempting to resume normally after an uncaught exception can be similar to pulling out of the power cord when upgrading a computer -- nine out of ten times nothing happens - but the 10th time, the system becomes corrupted.</p> <p><strong>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'.</strong></p> <p>To restart a crashed application in a more reliable way, whether uncaughtException is emitted or not, an external monitor should be employed in a separate process to detect application failures and recover or restart as needed.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload