On Mon, Mar 26, 2012 at 6:03 PM, Nuno Job <[email protected]> wrote:

> Well this is a real problem because when you are a module author people
> call things that don't exist, and those things can be called within the
> context of your library.
>
> Solutions don't exist, domains will tackle a bit of this problem and
> mature to a better solution. Still in the works, see
> http://nodeup.com/fifteen
>
> There are solutions if you "own" the code (https://github.com/pgte/bubble
> , https://github.com/substack/node-toss)
>
> Personally I found a way of doing this using uncaughtException but only if
> you serialize function calls. This way you can keep the ""stack"" (read,
> variables that matter to the execution of your program) and attach the
> uncaught handler just before the critical section, that is when you execute
> the code that was passed to your library. You then release the uncaught
> handler, cause you really should try to avoid it as much as you can.
>
> Here is where I implemented this:
>
>    - https://github.com/dscape/specify/blob/master/specify.js#L145
>
> This is super specific, it's ok for testing but not so sure about other
> uses (and potential abuse)  so I didn't publish a module.
>
>
> Thanks for the tips. I don't quite understand how to use domains yet but I
will have a look. For now I am safe as long as I make sure all my callbacks
are connected.

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