If you want to handle the case they're good/bad together:
//Require bluebird...
var Promise = require("bluebird");
// Run two tasks together
Promise
.all([Git.getRemotes(), GitFtp.getFtpRemotes()])
.spread(function (remotes, ftpRemotes) {
// Something cool
}).catch(function(err){
// handle errors on both
});
If you want to wait for both to either resolve or reject use Promise.settle
:
Promise
.settle([Git.getRemotes(), GitFtp.getFtpRemotes()])
.spread(function(remotesStatus,ftpRemoteStatus){
// the two are PromiseInspection objects and have:
// isFullfilled, isRejected, value() etc.
});