can.List.prototype.fail

  • function
 

list.fail( failCallback )

Add handlers to be called when the list is rejected. This works very similar to jQuery's fail.

Parameters

  1. failCallback {function(reason)}

    A function that is called when the list's promise is rejected. It will be called with the reason provided to reject.

Returns

{Promise}

The list's promise.

Use

var data = new can.Deferred();
var list = new can.List(data);

list.fail(function(reason){
  reason //-> "borked"
});

data.reject("borked");