function fn(){
var a = $.Deferred();
a.reject(‘hahaha精神工疾‘);
return a.promise();
}
fn().then(function() {
console.log(‘success 1‘);
},function (msg) {
console.log(msg);
}).then(function() {
console.log(‘success 2‘);
},function (msg) {
console.log(msg);
});
//‘hahaha精神工疾’
//underfined
then的错误执行会传递,但错误信息不传递
原文:http://www.cnblogs.com/cjy1993/p/3979103.html