a promise was created in a handler but was not returned from it in bluebird
<p>I'm using <code>bluebird</code> in my app and I use babel to compile my code into es5. However, I always got this warning and I've checked that every pieces of Promise has <code>return</code> value.</p>

<p>Here's my code:</p>

<pre><code>Promise.promisifyAll(fs);

use.login().then((result) =&gt; {
  console.log(result);
  doSomething('../test.png');
});

function doSomething(filepath) {
  return fs.readFileAsync(filepath).then((bufs) =&gt; (
      doPost(url, bufs, filepath)
        .then((res) =&gt; (
          res.error ? Promise.reject(res.error) : Promise.resolve(res))
        )
  )).catch((err) =&gt; {
    console.error(err);
    return err;
  });
}


function doPost(url, bufs = null, filepath = null) {
  return new Promise((resolve, reject) =&gt; (
    unirest.post(url)
      .headers(config.Headers)
      .timeout(120000)
      .field(bufs)
      .attach('files', filepath)
      .end((res) =&gt; (
        res.error ? reject(res.error) : resolve(res)
      ))
  ));
}
</code></pre>

<p>Details of error messages:</p>

<pre><code>Warning: a promise was created in a handler but was not returned from it
at doSomething (/home/test/Documents/test/lib/abc.js:2:27)
// This line number is referred to the compiled code which is equal to line 4:12 in the above code
</code></pre>