web/data/cubicweb.ajax.js
branchstable
changeset 6560 48ba5069e051
parent 6556 64b39aa0b047
child 6565 e89de028d004
child 6618 1268da8a2dbb
equal deleted inserted replaced
6556:64b39aa0b047 6560:48ba5069e051
    46         }
    46         }
    47         return this;
    47         return this;
    48     },
    48     },
    49 
    49 
    50     addErrback: function(callback) {
    50     addErrback: function(callback) {
    51         if (this._req.readyState == 4) {
    51         if (this._req.readyState == 4 && this._error) {
    52             if (this._error) {
    52             callback.apply(null, [this._error, this._req]);
    53                 callback.apply(null, [this._error, this._req]);
       
    54             }
       
    55         }
    53         }
    56         else {
    54         else {
    57             this._onFailure.push([callback, cw.utils.sliceList(arguments, 1)]);
    55             this._onFailure.push([callback, cw.utils.sliceList(arguments, 1)]);
    58         }
    56         }
    59         return this;
    57         return this;