On Tuesday, April 2, 2013 4:01:59 AM UTC+2, Alexey Petrushin wrote: > > > error coalescing is listed as a major benefit of promises > > None of control-flow helpers (steps, asyncs, promises, futures, tamejs, > ....) really helps with callbacks. None of them can intercept non-async > errors. > > As far as I know it's impossible to reliably catch both sync and async > errors, even code generators like tamejs can't do that. The only solution > is to patch JavaScript engine - like with Node.js Domains or Fibers. >
Streamline.js does intercept all errors (sync and async) and propagates them through catch/finally clauses (that have been transformed). This is validated by a suite of unit tests that exercises the different combinations. The transformation patterns are given in http://bjouhier.wordpress.com/2011/05/24/yield-resume-vs-asynchronous-callbacks/ The only case where this does not work is if the exception occurs inside the node.js low level code, before reaching a continuation that has been transformed by streamline; in short if there is a bug in node and node does not even call your callbacks. So this is not impossible, just non-trivial. Bruno -- -- 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 --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
