On Wednesday, November 14, 2012 at 6:24 PM, Jake Verbaten wrote:
> > https://gist.github.com/4075562/4c0e389da3e15048c2c99629eca28b8d96a7ebad


> Why does it fail?
> 

When the code running inside (the inner) domain d1 throws and d1's error 
handler calls the callback from (the outer) domain d2 with the error, the error 
in d2's callback gets emitted on d1's error handler because d1 wasn't cleanly 
exited. Either domain.bind() needs to run its callback inside a try / catch / 
finally block that emits the error on the domain handler and then exits the 
domain, or the uncaughtException handler installed by the domain module needs 
to figure out how to clean up the domain's state. The former seems a lot 
simpler, and would fix this problem for domain.run, domain.bind and 
domain.intercept, which is probably good enough for now and keeps everything 
relatively simple (although it incurs the overhead of v8 not being able to 
optimize try-catch blocks).

F

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to