Deferred: add .catch handler

Fixes gh-2102
This commit is contained in:
Timmy Willison
2015-07-06 10:13:01 -04:00
parent 8e4aac8cb0
commit 84ccf2606c
2 changed files with 39 additions and 0 deletions

View File

@@ -33,6 +33,9 @@ jQuery.extend({
deferred.done( arguments ).fail( arguments );
return this;
},
"catch": function( fn ) {
return promise.then( null, fn );
},
// Keep pipe for back-compat
pipe: function( /* fnDone, fnFail, fnProgress */ ) {
var fns = arguments;