Previously, onXHRProgress was being run when readyState was being set to DONE on error, which was causing exceptions.
window
global