When I am developing a client-side application, I wish there were a way to show Javascript runtime errors on the screen, so I don't have to check the console all the time to see if there was an error.
The only way I could imagine this working, would be some sort of error listener, something like this:
window.on('error',function(err){
$(document).html(JSON.stringify(err));
});
is there anything like this out there? When an error is thrown in front-end JS, can we create a handler for all those errors that bubble up to the global scope?
There is this, https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror, but it says that many errors do not get caught/trapped by that handler.