如何在没有.catch函数执行的情况下停止Promise.then执行?
Promise
.resolve("a")
.then(function(a){
console.log("step1 = " + a);
return a;
})
.then(function(a){
console.log("step2 = " + a);
if (!someReason) {
return Promise.reject(); // I whant to stop flow execution here
}
})
.then(function(a){
console.log("step3 = " + a);
return a;
})
.catch(function(err){
// I don't whant to have .catch() executed in case of planned stop
console.log("Flow failed");
});