-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Description
Version: 12.0.0-pre (78162ad)
Platform: Darwin geegaw.local 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64
Subsystem: async_hooks
https://gist.github.com/isaacs/1f8c5092ba7d67d9a5f4e342ff7778b7
I am building a domain-like implementation to catch errors using async_hooks. However, the executionAsyncId is reset to 0 on an unhandledRejection
event, making it impossible for me to know if I ought to handle the error or crash.
The weird thing is that it only fails in this way when the promise rejection is within an async hop, such as a setTimeout. If the promise rejection happens at the top level, then I get the expected value of 1
as the executionAsyncId.
This is preventing me moving node-tap off of core domains. Fewer modules using domains means that it could be deprecated sooner :)