• function

fail can.Deferred.prototype.fail

 

Add a callback to be called when a Deferred is rejected.

deferred.fail(failCallback)

Parameters

  1. failCallback {function()}

    A callback to be called when the Deferred is rejected.

deferred.fail(failCallback) adds handler(s) to be called when the Deferred object is rejected.

var def = can.Deferred();
def.fail(function(){
  //- Deferred got rejected.
});