code: function handleRequestError(eventTarget, type) {
    readyStateChange(eventTarget, states.DONE);
  
    dispatchProgressEvent(eventTarget, {
      type: 'progress',
      total: 0,
      loaded: 0,
      lengthComputable: false
    });
  
    dispatchProgressEvent(eventTarget, {
      type: type,
      total: 0,
      loaded: 0,
      lengthComputable: false
    });
  
    dispatchProgressEvent(eventTarget, {
      type: 'loadend',
      total: 0,
      loaded: 0,
      lengthComputable: false
    });
  }
docs: https://xhr.spec.whatwg.org/#handle-errors https://xhr.spec.whatwg.org/#request-error-steps