I don't want to speak on Adam's behalf, but I think his point was that with 
trycatch the error ends up in the right place, whether or not the error is the 
fault of the devs or a third party module. That seems like a good base-level 
requirement for domains as well.

I'll see if I can put together a pull request to address this.

F

On Nov 14, 2012, at 19:17, Jake Verbaten <[email protected]> wrote:

> So it fails because `console.log(err.errors[0])` throws a `err` does not have 
> `errors[0]` property.
> 
> Is this not a bug in thirdParty because it calls the callback before it 
> disposes the domain?
> 
> cc izs: this should probably be fixed or documented at least.
> 
> 
> On Wed, Nov 14, 2012 at 6:37 PM, Forrest L Norvell <[email protected]> 
> wrote:
>> 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
> 
> -- 
> 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

-- 
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