Hello dojo users
I'm always having a hard time to debug programmatic errors in deferred functions. Let's have a look at an example, where myPane is a ContentPane:
myPane.set("onDownloadError", function(err) {
var myNull;
myNull.get("foo");
return err.message;
});
myPane.set("href", "some/url");
There is a bad bug in the "onDownloadError" function. In the console I see:
8<-------------------------------------------------------------------
Errorarguments: undefinedget stack: function getter() { [native code] }message: "This deferred has already been resolved"
set stack: function setter() { [native code] }type: undefined__proto__: ErrorPrototype
dojo.Deferred.reject.errback Deferred.js:216
dojo.Deferred.reject.errback Deferred.js:216
notify Deferred.js:186
complete Deferred.js:162
dojo.Deferred.reject.errback Deferred.js:213
notify Deferred.js:186
complete Deferred.js:162
dojo.Deferred.resolve.callback Deferred.js:203
notify Deferred.js:184
complete Deferred.js:162
dojo.Deferred.resolve.callback Deferred.js:203
_resHandle xhr.js:620
func xhr.js:506
_watchInFlight xhr.js:525
8<-------------------------------------------------------------------
There is no actual trace to the function that cause this error.
How do I actually find out that this error comes from the onDownloadError handler? What's a good way to debug such errors?
Best regards,
James