-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't recommend domains for error handling #2056
Conversation
Not saying it's not, but it should be clear that unhandledException should not be used for error recovery. |
Improvement suggestions? Seems az clear as it gets to me :) |
The "On Error Resume Next" is a strange to me. I understand what it means but I had to google to know it is a VB concept. |
@targos , I actually didn't change that part but I quite like it, I understood it but I never professionally did VB. I don't mind changing it while I'm at it if you have a suggestion :) |
What about:
|
I'd rather not impose words like middleware that not everyone knows on the documentation, if someone is just now exploring what unhandledRejection is I'm not sure they'd understand that. |
Agree. What about:
|
This seems pretty strong already to me. Wouldn't you agree? |
Can anyone else LGTM and/or merge it? |
LGTM |
+1 |
It is mainly useful to perform synchronous cleanup when the server is at a | ||
problematic state in order to gracefully shut down. | ||
|
||
If you do use it, restart your application after every unhandled exception! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sounds right but I might say:
Handling this type of exception recognizes an unrecoverable problem with the application, at which point it is time to both: restart the application and investigate further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Recognizes an unrecoverable problem" sounds a bit unclear to me, do you mind rephrasing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, if that's unclear, I guess the main point there is that such an exception shouldn't be held out as a crutch to blindly restart applications, carrying on as if nothing happened, but rather an occasion to re-evaluate some area that is unfinished or very likely broken
This PR closes nodejs#2055 by removing the suggestion to use domains for exception handling. Additionally clarify `unhandledException` a bit. PR-URL: nodejs#2056 Reviewed-By: Trev Norris <trev.norris@gmail.com> Reviewed-By: Chris Dickinson <chris@neversaw.us>
Sorry for the time it took, squished, added |
Landed with git commit message fix, and removal of trailing whitespace on 0f09b8d. |
Remove the suggestion to use domains for exception handling. Add clarity to "unhandledException". Fixes: nodejs#2055 PR-URL: nodejs#2056 Reviewed-By: Trev Norris <trev.norris@gmail.com> Reviewed-By: Chris Dickinson <chris@neversaw.us>
This PR closes #2055 by removing the suggestion to use domains for exception handling. Additionally clarify
unhandledException
a bit.PR-URL: #2056