Clean up XHR error handling
IE8 compat fix