deferred.fail()


deferred.fail( failCallbacks [, failCallbacks ] )Возвращает: Deferred

Описание: С помощью этого метода можно установить обработчики перехода объекта deferred в состояние удачного выполнения, ошибки выполнения(resolved или rejected).

The deferred.fail() method accepts one or more arguments, all of which can be either a single function or an array of functions. When the Deferred is rejected, the failCallbacks are called. Callbacks are executed in the order they were added. Since deferred.fail() returns the deferred object, other methods of the deferred object can be chained to this one, including additional deferred.fail() methods. The failCallbacks are executed using the arguments provided to the deferred.reject() or deferred.rejectWith() method call in the order they were added. For more information, see the documentation for Deferred object.

Примеры использования