On the other hand, it seems like one of your goals here is to keep from proxying additional commands if there's an error, which is a good goal. So your current setup is like this:

```
- loop through all elements
  - for each element, check whether we previously encountered an error
  - if so:
    - do nothing
  - if not:
     - proxy command
     - if we got an error:
        - set global error object
     - otherwise, continue with loop
```

There's another way to do things which might be more natural. Instead of looping through all elements, we create a method that calls itself and pops an element from a stack until (a) all elements are gone, or (b) an error occurs. In that situation, we can easily short-circuit the process without having to keep track of whether we received an error before:

```js
// assume we have a list of items in 'items'
var doSomethingWithAnItem = function() {
  var item = items.pop();
  if (typeof item === "undefined") {
    cb(); // we're done, call the main callback's success case
  }
  doSomethingAsyncWithAnItem(item, function (err, val) {
    if (err) return cb(err); // short-circuit the loop and send the error up
    // now we do something with val
    values.push(val);
    // and can continue through the loop
    doSomethingWithAnItem();
  });
};
```