Top level exception mechanism
Is it possible to add a top level exception mechanism?
I use JQuery to register a handler for some event like this:
-
$('#myButton').click(function() {
doSomething();
});
Then, somewhere deep inside my doSomething() code, an exception is thrown.
-
var doSomething = function() {
throw new Error('Something went wrong.');
}
What I want to do is to act on any uncaught exception like this one and handle it (display an error message or whatever). Is this possible to do with JQuery?