turbonetix/stairs — pull request #3 by tandrewnichols (2014-08-10 13:13:38+00:00)
Title: Return null as first callback arg for funcions that look for err

I'm doing something like this with stairs:

```coffee
async.each options.env, (env, next) ->
stairs.step('foo', utils.foo).step('bar', utils.bar).run(options, env, next);
, (err) ->
```

This doesn't work since, async.each expects the first argument to the final callback to be the error (or null). Since steps returns `scope` as the first argument, async interprets this as an error. I can't think of any reason _not_ to return null as the error and scope as the second argument there so that stairs is more compatible with other node module APIs.

I'm not sure whether to also call `this.end(err)` when `next` receives an error. That would terminate the process without finishing, so that seems undesirable, but it might also be reasonable to assume that future steps won't be complete successfully if a previous one failed.