I have multiple ajax calls that can fail. I would like to chain them all using something like below, but catch and react to any possible failure. If possible can you include a jsbin. Thanks.
first()
.then(function(){
return second();
})
.then(function(){
return third();
})
.fail(function(){
// this should catch any failures above
alert(failed)
})