mercredi 5 août 2015

Showing client errors to screen in development mode

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, http://ift.tt/1IIki3U, but it says that many errors do not get caught/trapped by that handler.




Aucun commentaire:

Enregistrer un commentaire