title: Bluebird Warning : a promise was created in a handler but was not returned from it
body: <p>I have an array of filenames which I iterate using this async module for node.</p>
  
  <pre><code>       async.eachSeries(imageStore, function(imageDetails,callback){
              mongoMan.updateCollection('imageStore',imageDetails,{_id: imageDetails.fileName}).then(function(res){
                    return callback(null, res);
                  }).catch(function(err){
                    logger.error(err);
                    return callback(err);
                  });
              },function(err){
                callback(null);
              });
  </code></pre>
  
  <p>The updateCollection() function is like this:</p>
  
  <pre><code>exports.updateCollection = function(collection, values, condArr){
  
    var result = imageStores.updateAsync(condArr, values, { upsert: true }).then(function(res){
      return new Promise.resolve(res);
    }).catch(function(err){
      logger.error(err);
    });
  
    return new Promise.resolve(result);
  }
  </code></pre>
  
  <p>This code works well, updates DB and everything. But I am still unable to resolve the warning that bluebird throws:</p>
  
  <pre><code>Warning: a promise was created in a handler but was not returned from it
  at Object.exports.updateCollection (/home/swateek/Documents/codebase/poc/apps/webapp/server/components/mongodb/mongoConn.js:46:22)
  at /home/swateek/Documents/codebase/poc/apps/webapp/server/components/imageStore.js:72:24
  at /home/swateek/Documents/codebase/poc/apps/webapp/node_modules/async/lib/async.js:181:20
  at iterate (/home/swateek/Documents/codebase/poc/apps/webapp/node_modules/async/lib/async.js:262:13)
  </code></pre>
  
  <p>Have looked up solution<a href="http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-created-in-a-handler-but-none-were-returned-from-it" rel="nofollow">here</a> but that ain't convincing enough in my case. Atleast is there a way to turn off the warning?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Please check the correct answer below, and here's how my calling function looks like:</p>
  
  <pre><code>function(callback){// post imageStore data to DB
            async.eachSeries(imageStore, function(imageDetails,callback){
              mongoMan.updateCollection('imageStore',imageDetails,{_id: imageDetails.fileName}).catch(function(err){
                    logger.error(err);
                    return callback(err);
                  });
              return callback(null);
              },function(err){
                callback(null);
              });
          }
  </code></pre>