Skip to content

Commit 0f09b8d

Browse files
benjamingrtrevnorris
authored andcommitted
doc: don't recommend domains for error handling
Remove the suggestion to use domains for exception handling. Add clarity to "unhandledException". Fixes: #2055 PR-URL: #2056 Reviewed-By: Trev Norris <[email protected]> Reviewed-By: Chris Dickinson <[email protected]>
1 parent 9cd44bb commit 0f09b8d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/api/process.markdown

+5-3
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,18 @@ Example of listening for `uncaughtException`:
104104
Note that `uncaughtException` is a very crude mechanism for exception
105105
handling.
106106

107-
Don't use it, use [domains](domain.html) instead. If you do use it, restart
108-
your application after every unhandled exception!
109-
110107
Do *not* use it as the io.js equivalent of `On Error Resume Next`. An
111108
unhandled exception means your application - and by extension io.js itself -
112109
is in an undefined state. Blindly resuming means *anything* could happen.
113110

114111
Think of resuming as pulling the power cord when you are upgrading your system.
115112
Nine out of ten times nothing happens - but the 10th time, your system is bust.
116113

114+
`uncaughtException` should be used to perform synchronous cleanup before
115+
shutting down the process. It is not safe to resume normal operation after
116+
`uncaughtException`. If you do use it, restart your application after every
117+
unhandled exception!
118+
117119
You have been warned.
118120

119121
## Event: 'unhandledRejection'

0 commit comments

Comments
 (0)