mirror of
http://git.whoc.org.uk/git/password-manager.git
synced 2024-11-14 08:39:01 +01:00
Improved Async logging in case of deferred being cancelled
This commit is contained in:
parent
a362a03cbe
commit
51e2e19014
@ -61,13 +61,18 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.chained == false) {
|
if (this.chained == false) {
|
||||||
var message;
|
var deferredName = this._name;
|
||||||
|
|
||||||
message = "ERROR [" + this._name + "]";
|
|
||||||
this.addErrback(function(aResult) {
|
this.addErrback(function(aResult) {
|
||||||
|
var message;
|
||||||
|
|
||||||
if (! (aResult instanceof MochiKit.Async.CancelledError)) {
|
if (! (aResult instanceof MochiKit.Async.CancelledError)) {
|
||||||
Clipperz.log(message, aResult);
|
message = "ERROR [" + deferredName + "]";
|
||||||
|
} else {
|
||||||
|
message = "CANCELLED - " + deferredName;
|
||||||
}
|
}
|
||||||
|
Clipperz.log(message, aResult);
|
||||||
|
|
||||||
return aResult;
|
return aResult;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -101,7 +106,7 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
|
|||||||
// this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;});
|
// this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;});
|
||||||
this.addCallbacks(
|
this.addCallbacks(
|
||||||
function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
|
function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
|
||||||
function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
|
function(aResult) {if (! (aResult instanceof MochiKit.Async.CancelledError)) { Clipperz.log("FAIL " + message + "-->"/*, aResult*/);}; return aResult;}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +116,7 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
|
|||||||
// this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;});
|
// this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;});
|
||||||
this.addCallbacks(
|
this.addCallbacks(
|
||||||
function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;},
|
function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;},
|
||||||
function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
|
function(aResult) {if (! (aResult instanceof MochiKit.Async.CancelledError)) { Clipperz.log("FAIL " + message + "<--", aResult);}; return aResult;}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user