title: async.auto: stop entire chain after first error
body: <p>I was under the impression that the behavior of <code>async.auto</code> was that if one of the tasks returned an <code>err</code>, the global callback would be called with this error and <strong>all</strong> subsequent tasks would not execute. After all, why would they? The global callback has been called so the error has been reported already.</p>
  
  <p>It turns out that only tasks <em>that depend on the faulty task</em> will not run, and the rest will.</p>
  
  <pre><code>'use strict';
  
  var async = require('async');
  
  async.auto({
      downloadAudio: function (callback) {
          console.log("downloading audio...");
          setTimeout(function () {
              console.log("downloaded audio.");
              callback();
          }, 10000);
      },
      downloadScript: function (callback) {
          console.log("downloading script...");
          setTimeout(function () {
              return callback(new Error("ERROR downloading script!"));
          }, 1000);
      },
      preprocessAudio: ['downloadAudio', function (callback) {
          console.log("preprocessing audio...");
          setTimeout(function () {
              console.log("done preprocessing audio.");
              callback();
          }, 5000);
      }]
  }, function (err) {
      if (err) {
          return console.error(err.message);
      }
  
      console.log('done.');
  });
  </code></pre>
  
  <p>In this code snippet, both <code>downloadAudio</code> and <code>downloadScript</code> will immediately run in parallel, and <code>preprocessAudio</code> depends on <code>downloadAudio</code>. The problem is that when <code>downloadScript</code> returns an <code>err</code>, <code>preprocessAudio</code> will still run, even though there's no point because the thing failed as a whole already:</p>
  
  <pre><code>downloading audio...
  downloading script...
  ERROR downloading script!
  downloaded audio.
  preprocessing audio...
  done preprocessing audio.
  </code></pre>
  
  <p>I know, I could make <code>preprocessAudio</code> depend on <code>downloadScript</code> also but that means that <code>preprocessAudio</code> would wait for <code>downloadScript</code> to complete, even though they could run in parallel without a problem.</p>
  
  <p>Is there any elegant way to solve this?</p>
  
  <p>Thanks,
  Jan</p>