We are currently using the following code to track javascript errors on our website:
window.onerror = function(message) {
log(message);
};
The log-function in the code above displays the error message within the console for developers but not for regular users. We are thinking about displaying some kind of information for regular users and then to reload the page after the user confirms the message. It would however be better if we could figure out a way to make sure that javascript continues to work even after an error has occurred. So we are wondering if there is a way to "re-initialize" javascript to start over after an error has occurred. Any help would be appreciated. Thanks