Catching All Errors

Catching All Errors

Hi All,

My application is mostly all ajax, using jquery (of course!). Over the past few days, I've been trying to create a method to catch or trap most errors in a universal way. The idea being that when our native application-level error handling fails, the application is left in an unreliable and unknown state, so I'd like to both record as much information as possible, and reset the application (i.e. refresh the page).

To do this, I need to monitor the window.onerror, and thanks to the helpful post here  http://blogs.cozi.com/tech/2008/04/javascript-error-tracking-why-windowonerror-is-not-enough.html I've also been able to overload the fn.bind to encapsulate most jquery function calls in a try...catch block.

The issue I am having is if I cause an error on the page, it is successfully caught, but if the handler was an anchor, the page continues navigating, and I've tried several ways to stop the event propagation, without success.

Anyone have any ideas?

Thanks,

Johnathan