<p>A while ago I wrote a small piece of JavaScript code that I needed to be able to integrate into lots of different sites to help streamline the Silverlight experience, but it was important that I didn&rsquo;t break anyone&rsquo;s existing code.</p> <p></p> <p>While we did extensive testing with the partners before we deployed it there was always the worry that a combination of browser and OS and plug-in we&rsquo;d not tested would cause a problem we&rsquo;d not foreseen.</p> <p></p> <p>As websites get more complex, and HTML5 brings more of the heavy lifting back to rely on JavaScript to build really dynamic experiences so my little nagging concern was just going to keep on getting bigger.</p> <p></p> <p>While you can wrap every statement in a Try&hellip;Catch loop and deal with exceptions that way it&rsquo;s not the most efficient, and if you&rsquo;re integrating libraries from a&nbsp; lot of different sources then it&rsquo;s not really practical.</p> <p></p> <p>As luck would have it two of the browsers had already implemented the key to the solution&hellip; the humble JavaScript <i>window.onError</i> function. In IE and Firefox it allowed you to attach an event handler that would kick in whenever an un-trapped error occurred and allow you do to whatever you needed to manage the problem.</p> <p></p> <p>I took that functionality and build a small script that could be injected via a single line of JavaScript into the page you want to monitor that would catch any unhandled error condition and report back to a remote cloud service the script, the error, the browser and OS versions so a developer could quickly and easily re-create the test scenarios. The code is available at <a href="http://jsErrLog.appspot.com">jsErrLog</a>.</p> <p></p> <p>Then because Chrome, Safari and Opera didn&rsquo;t support the onError function I rather shelved the project. Just a few days though with the release of Chrome v10 another browser could be added to the support matrix for remote error reporting (and as the fix is in the WebKit core we can only hope that a release of Safari greater than v5 will roll out support as well)</p> <p></p> <p>While I wait for Safari and hopefully Opera to catch up with this I&rsquo;m making a couple of other small tweaks to the code to make it a bit more reliable, as well as adding some extra functionality to allow developers to pass additional information back to the reporting database to help with debugging their specific apps.</p> <p></p> <p><a href="http://jsErrLog.appspot.com"> Check it out </a>, kick the tires and let me know if you have any feedback&hellip;</p>