Get all javascript errors on page/javascript error handling

I have mine working with window.onerror and it doesn’t stop my javascript:

window.onerror = function(error, url, line) {
    controller.sendLog({acc:'error', data:'ERR:'+error+' URL:'+url+' L:'+line});
};

Note that controller.sendLog is a function that sends this data to a logging php.

Can be because you’re causing some javascript error inside that function?

Leave a Comment