-
Notifications
You must be signed in to change notification settings - Fork 30k
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
async_wrap: provide a way to act as an asynchronous try-catch #7040
Comments
I originally implemented this behavior in AsyncListener almost 3 years ago (ref bc39bdd and 828f145). It leads to a hairy mess, and while I'm not opposed to it, it definitely won't be going into the initial public API. As a work around it is possible to setup and tear down an So, in short, let's wait until after initial implementation before discussing how to implement this. |
While I can live with using an |
Yes. Initial release will have full support for timers, |
Great 👍 |
Any progress on this? I really hope not to run on quick sands forever (namely, relying on the current error domains). |
Yes. I'm furiously finishing it up in preparation for a PR. |
Any news on this? |
@acarstoiu You can track the progress of this at #11883, subscribe to that thread and you’ll know when this gets merged. :) I’m closing this, but feel free to let us know if it should be re-opened, or ask any follow-up questions that you have. |
@trevnorris, in just a few words, the async_wrap module should be capable of acting like a
try{} catch() {}
over asynchronous fragments, includingnextTick
(I'm aware of #6082) and timers. Why? To pave the way to replacing the current error domains.In my view, the execution should simply not get to process._fatalException when the error is handled. I noticed that the API presented in this talk doesn't even pass the thrown value.
The text was updated successfully, but these errors were encountered: