It really depends on context. Do the semantics of the API indicate that trying to do as much work in parallel with a few errors is okay (errors parameter) or it is an all or nothing approach (single error parameter). In some cases you might want to leave that decision up to the caller and provide both options, something akin to the difference between Promise.all and Promise.race.
-- Daniel R. <[email protected]> [http://danielr.neophi.com/] On Wed, Jul 15, 2015 at 8:20 PM, Quentin Engles <[email protected]> wrote: > I'm wondering what everyone's opinion is on handling errors over time. > > In the interfaces of some modules I've seen errors collected into an array > with an *errors parameter* in the callback. Used this way all jobs are > done even after an error is encountered. > > In others when an error is encountered the remaining jobs are quit, and a > *single > error parameter* is used in the callback. > > On error at least one job is incomplete either way, but with the *error > collector style* future jobs are still complete. > > There is array, or single aggregated error style for the parameter. So > this question really isn't about array of errors vs. single error. What I'd > like to know is should future jobs after error be complete, or should > errors stop all jobs? > > There is also *on('error', cb)*, but that is just another optional > implementation detail. I want to stick with non-event style interfaces in > this conversation. > > -- > Job board: http://jobs.nodejs.org/ > New group rules: > https://gist.github.com/othiym23/9886289#file-moderation-policy-md > Old group rules: > 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 unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/nodejs/8c39cf77-f502-472a-b3e7-b6634dfe9f74%40googlegroups.com > <https://groups.google.com/d/msgid/nodejs/8c39cf77-f502-472a-b3e7-b6634dfe9f74%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAETDeSCRd87Ai%3D9R4_pwz0-Kdm_mk%3DWYgVbMTyb5tBn21jDbww%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
