The buttons throw exceptions from non-dojo javascript.
The pink DIV is a dojo widget that throws an exception.
In IE all of these exceptions are handled as expected
(the Handler widget is displayed).
In FireFox, however, the exception thrown by the pink widget is
not caught by the Handler widget. :-(
Throw this error ===>
D'oh -- Invalid object
The Handler widget code:
dojo.provide("webmap.widget.Handler");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.declare("webmap.widget.Handler", [dijit._Widget, dijit._Templated], {
templateString: '<div style="display:none;background-color:orange;width:200px" ' +
'dojoAttachEvent="onclick: doClick">This is the exception hadling widget. ' +
'Click to clear.</div>',
postCreate: function(){
dojo.connect(window, "onerror", this, "_catchUnhandled");
},
doClick: function(e){
alert(this.domNode.title);
dojo.style(this.domNode, "display", "none");
},
_catchUnhandled: function(message, url, line){
this._activate();
},
_activate: function(){
this.domNode.title = "An error has occured";
this.domNode.alt = this.domNode.title;
dojo.style(this.domNode, "display", "block");
}
});
The Error widget code:
dojo.provide("webmap.widget.Error");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.declare("webmap.widget.Error", [dijit._Widget, dijit._Templated], {
templateString: '<div style="background-color:pink;width:200px" ' +
'dojoAttachEvent="onclick: doClick">' +
'Click here to to simulate unhandled exception in widget</div>',
doClick: function(e){
throw "This is an unhandled exception!";
}
});