title: Retry a promise step
body: <p>Suppose I have the the following Promise chain:</p>
  
  <pre><code>var result = Promise.resolve(filename)
      .then(unpackDataFromFile)
      .then(transformData)
      .then(compileDara)
      .then(writeData);
  </code></pre>
  
  <p>Now I have not only one <code>transformData</code> function but two or more, stored in an array. I want to try the first one, and if the <code>compileData</code> function fails, try the second one and so on until either <code>compileData</code> succeeds or the array of <code>transformData</code> functions is exhausted.</p>
  
  <p>Can someone give me an example on how to implement this?</p>
  
  <p>Running all <code>transformData</code> functions and give the result array to <code>compileData</code> is not an option, since the functions are very expensive and I want to run as few as possible of them. </p>
  
  <p><code>transformData</code> itself also returns a Promise, if that helps.</p>