How do I catch ES6 Promise rejections and completely stop flow?
问题 Say I have 4 functions: runA() , runB() , runC() and runD() . Using ES6 promises, in a completely successful run, these would all be run one after another: runA() .then(runB) .then(runC) .then(runD) If runA or runB fail (reject or throw), I would like to call error1() and then completely stop the chain (not call runC or runD ). This makes me think I should add a single .catch() at the very end of the .then promise chain: runA() .then(runB) .then(runC) //won't get called if runA or runB throws