On Aug 29, 2013, at 7:09 PM, Isaac Schlueter <i...@izs.me> wrote: > On Thu, Aug 29, 2013 at 11:19 AM, Bryan Donovan <brdono...@gmail.com> wrote: >> Thanks, I just wanted to make sure my understanding was correct in that >> there really is no problem with the specific case I presented. > > That understanding is incorrect. > > The exact problem being described in Havoc's post and in mine, is a > problem with the specific case you presented.
I do understand how it's inconsistent, and I see how it *could* be a problem, but I still haven't seen an example of how my example would cause a real problem in a real application. Let's pretend it's not a public npm for a minute and this 'db' is a home-grown internal module. Say I'm on a team with 10 developers, all working on a REST API using this module. Is there a scenario that would cause a problem in this app due to immediately calling back? I'm trying to figure out whether it's worth it to go back and change every place in our app that does an immediate callback. Given that I haven't seen any issues with this in two years, I doubt it's really an issue (again, for an internal app, not a public library). But maybe there are issues we just haven't noticed. > > Throw now, or nextTick the callback. Don't do it half-way. > > On Thu, Aug 29, 2013 at 7:04 PM, Isaac Schlueter <i...@izs.me> wrote: >> if (!args.index) { next(new Error('index required')); } >> if (!args.type) { next(new Error('type required')); } > > Ugh, a bug in my example. It should be `return next(new Error(...))`, > so that it doesn't try to do the async thing if it's already called > the cb with an error. > > -- > -- > 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 nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > 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 a topic in the Google > Groups "nodejs" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nodejs/0TmVfX9z1R0/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > nodejs+unsubscr...@googlegroups.com. > 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 nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com 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 nodejs+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.