[nodejs] Re: Async Error Handling and Domains

2012-02-13 Thread Juraj Vitko
Interesting - benching it was my plan asap (as well as writing unit tests). I was kind of hoping that v8 would be making a simple copy of the stack trace it records anyway, and cheaply store that into the Error object somehow. In any case, any form of pre-processing is way too intrusive to me, and

[nodejs] Re: Async Error Handling and Domains

2012-02-13 Thread Bruno Jouhier
On Feb 13, 1:56 pm, Jann Horn wrote: > Doesn't that mean that plain async methods might be missing in the > generated trace? Yes, unfortunately. It won't happen with low level async calls like fs.readFile, db calls, etc. but it may happen if you have intermediate async functions to which you p

Re: [nodejs] Re: Async Error Handling and Domains

2012-02-13 Thread Jann Horn
Doesn't that mean that plain async methods might be missing in the generated trace? Am 13.02.2012 09:25 schrieb "Bruno Jouhier" : I had to handle this in streamline and I also did it similarly with a small callback wrapper that does the try/catch. On the other hand, I found that allocating an Er

[nodejs] Re: Async Error Handling and Domains

2012-02-13 Thread Bruno Jouhier
I had to handle this in streamline and I also did it similarly with a small callback wrapper that does the try/catch. On the other hand, I found that allocating an Error object to keep track of the source stack is very costly (a new Error call costs 400 empty object {} allocations) so I chose to g

[nodejs] Re: Async Error Handling and Domains

2012-02-12 Thread Juraj Vitko
Wow, I did not know about domains. In the meantime, what approach do you take for async error handling? I have found multiple libs but they all were too intrusive and/or syntax-sugary, so I attempted my own, which I do use: https://github.com/ypocat/laeh2 Always looking for better methods though

[nodejs] Re: Async Error Handling and Domains

2012-02-10 Thread Brad Carleton
That sounds great! I really hope this is able to make it into 0.8. On Feb 10, 11:23 am, Ben Noordhuis wrote: > On Fri, Feb 10, 2012 at 16:42, Brad Carleton wrote: > > Very interesting, so could a domain cover an entire request in your > > typical web application.  Basically,giving you the abili

Re: [nodejs] Re: Async Error Handling and Domains

2012-02-10 Thread Ben Noordhuis
On Fri, Feb 10, 2012 at 16:42, Brad Carleton wrote: > Very interesting, so could a domain cover an entire request in your > typical web application.  Basically,giving you the ability to respond > to any error that may occur in an async callback, because the domain > would be keeping the context of

[nodejs] Re: Async Error Handling and Domains

2012-02-10 Thread Brad Carleton
Very interesting, so could a domain cover an entire request in your typical web application. Basically,giving you the ability to respond to any error that may occur in an async callback, because the domain would be keeping the context of the initial request? That would be a really big win for req