-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Exceptions in progress handlers are not caught #295
Comments
Hmm, I thought I had good arguments against this, but when I start typing them out they seem less strong. Tagging in @briancavalier in case he has any thoughts; I know it's an area he's considered a lot in when.js. |
This comment has most of my thoughts on why this is tricky. Honestly, I had to re-read them, since I haven't throught about this issue in a while. The biggest problems that I see (see the above comment for more detail) are: 1) allowing promise I hope there's a better alternative, but the only things that seem at all reasonable to me right are:
I just re-read this idea from over at Promises/A+, and now I'm very intrigued by it. I need to give it more thought, but would be interested to hear @domenic's and @ForbesLindesay's latest thinking on it as well. |
Thanks Brian; I knew that rejecting I agree that that other idea was pretty interesting. Although, the strangeness of it (i.e. the way that |
I still think I like that idea better than anything else I've tried. I've not had a chance to experiment with it but returning a promise from the I still think making progress handlers deal with the errors thrown by other progress handlers is downright weird. I think I prefer crashing to that option. |
OK, it's decided. |
In this example node program, I expect the "Oops..." exception to be caught by the final
fail
handler. Instead it's not caught by anything and causes node to crash. Placing thethrow
in thethen
handler behaves as expected (it's caught by thefail
handler).The text was updated successfully, but these errors were encountered: