<commit_before>window.onerror
==============

simple window.onerror handler<commit_msg>Added proper readme<commit_after>window.onerror
==============

Simple window.onerror handler which will let you send client-side JavaScript errors for post mortem analysis.

Include onerror.js on your page and initialize the script: `initErrorHandler('/url-to-post-error', 'static.content.com')`.

Only errors from JavaScript files at the `static.content.com` will be reported, which will prevent you from receiving unwanted errors from browser add-ons or errors in development mode.

On the server side at `/url-to-post-error` you will receive the page `location`, error `message`, `scriptUrl`, `line` number and `useragent`. You could aggregate them in a log file and send the errors once a day or whatever works best for you ;-).

To run the tests you need [buster.js](http://busterjs.org).
{'fraction_non_alphanumeric': 0.11237230419977298, 'fraction_numerical': 0.0, 'mean_word_length': 5.082758620689655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2510084', 'n_tokens_mistral': 230, 'n_tokens_neox': 226, 'n_words': 106}