Skip to content

Commit 06f07a6

Browse files
author
Noah Rose
committed
doc: revise the restrictions of catching an uncaughtException
1 parent 79b8c2e commit 06f07a6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/api/process.markdown

+3-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ Do *not* use it as the Node.js equivalent of `On Error Resume Next`. An
118118
unhandled exception means your application - and by extension Node.js itself -
119119
is in an undefined state. Blindly resuming means *anything* could happen.
120120

121-
Additionally, no more than one uncaughtException can be caught per tick. Subsequent exceptions will print the stack trace and exit. In the case that more than one uncaughtException must be caught, ensure that continuation of the program is delayed until the next tick. This can be achieved by using [`Process.nextTick`][].
121+
Exceptions thrown from within the event handler will not be caught. Instead the
122+
process will die and the stack trace will be printed. This is to avoid
123+
infinite recursion.
122124

123125
Think of resuming as pulling the power cord when you are upgrading your system.
124126
Nine out of ten times nothing happens - but the 10th time, your system is bust.
@@ -1080,7 +1082,6 @@ Will print something like:
10801082
[`net.Server`]: net.html#net_class_net_server
10811083
[`net.Socket`]: net.html#net_class_net_socket
10821084
[`process.exit()`]: #process_process_exit_code
1083-
[`process.nextTick`]: #process_process_nexttick_callback_arg
10841085
[`promise.catch(...)`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
10851086
[`'rejectionHandled'`]: #process_event_rejectionhandled
10861087
[`require.main`]: modules.html#modules_accessing_the_main_module

0 commit comments

Comments
 (0)