properly handle errors with timeouts on the native XHR