In Chrome\'s JavaScript console, if I run this:
var that = new XMLHttpRequest(); that.open(\'GET\', \'http://this_is_a_bad_url.com\', false); that.send();
I think what you meant was:
if(exception.name == 'NetworkError'){ console.log('There was a network error.'); }
I don't believe the Error is an instance of NetworkError, but thrown in this manner:
NetworkError
throw { name: 'NetworkError', message: 'A network error occurred.' // etc... }