I've utilized a `errorCallback` pattern in `after` ( https://github.com/Raynos/after/blob/master/lib/after.js#L15 ). Basically when doing multiple operations in parallel the first error goes to the callback immediately. Any other errors go to the error callback if registered.
I actually don't use the errorCallback and just don't deal with multiple parallel errors explicitly other then bubble it up. On Wed, Jun 26, 2013 at 3:54 PM, Daniel Rinehart <[email protected]> wrote: > To me it is a question of 'Can the caller do anything useful with the fact > that an error occurred?' In general I find the answer is no. There are a > great many things that could have gone wrong to cause the error and I don't > want to have to handle them in each place I make use of async.parallel. As > such I like async.parallel's approach of fail fast and report the first > error. I code the callback with the contract that all results are there > since it avoids needless undefined checks. If I don't care if some of the > parallel calls fail, I'm going to wrap the call in a module or function > that knows how to do something reasonable with the error and use the null > object pattern so that the callback contract can remain unchanged. Trying > to bake that level of intelligence into the library seems too be mixing > concerns too much. > > > > > -- Daniel R. <[email protected]> [http://danielr.neophi.com/] > > > On Wed, Jun 26, 2013 at 1:15 PM, Alan Gutierrez <[email protected]>wrote: > >> I'm writing a `Step` inspired error-first control flow library that >> encourages >> parallelism. Does anyone here regularly use `async.parallel` or similar >> and when >> you do, what is your strategy for exposing errors to the caller? >> >> A more detailed question is here: >> >> >> https://github.com/bigeasy/cadence/blob/master/diary.md#what-do-nodejs-veterans-expect-from-an-error-first-callback >> >> -- >> Alan Gutierrez ~ @bigeasy >> >> -- >> -- >> 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. >> >> >> > -- > -- > 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. > > > -- -- 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.
