我對ES6中的Promise鏈感到困惑。關於ES6中的Promise鏈
function taskA() {
console.log("Task A");
throw new Error("throw Error @ Task A")
}
function taskB() {
console.log("Task B");
}
function onRejected(error) {
 console.log(error);// => "throw Error @ Task A"
}
function finalTask() {
console.log("Final Task");
}
var promise = Promise.resolve();
promise
.then(taskA)
.then(taskB)
.catch(onRejected)
.then(finalTask);
就是我在這裏失去了就是爲什麼finalTask
會叫什麼名字? catch()
鏈是否返回已解決的Promise?
[Chained promises not passing on rejection](http://stackoverflow.com/q/16371129/1048572) – Bergi