Functionality for gathering JavaScript errors + stacktraces from websites


It would be awesome if there were an HttpHandler that could receive a JavaScript error (including URL-coming-from, stacktrace and other useful-for-debugging-after-the-fact data) - an HttpHandler so that it could be dropped in via configuration.
Then, hopefully an errorreporter.js which could hook onto the window.error event (or whatever is the appropriate thing to do per browser) and push JS errors into the logs, to then be harvested and reportable-on in the same way that .NET exceptions are.
The JS to do this would need to operate asynchronously and unobtrusively to maintain a decent user experience.