をトリガしない `.catch`コールバックは、私はネイティブの約束を使用して、次のコード持っている:私はそれを実行するとはなぜ
function getUser() {
return new Promise(function (resolve, reject) {
reject();
});
}
function changeUser() {
return new Promise(function (resolve, reject) {
return getUser().catch(function (responseData, test) {
console.log('boo error'); // this logs `boo error`
throw {};
});
});
}
changeUser().then(function() {
console.log('done');
}).catch(function() {
console.log('error'); // this is not triggered
});
を、console.log('error');
とLST catch
ブロックは実行されません。何故ですか?ネイティブの約束の実装はQ
と異なっていますか?
http://stackoverflow.com/questions/33445415/javascript-promises-reject-vs-throwこの –