function _wrapXHR(client, options) {
  if (!('XMLHttpRequest' in utils.GLOBAL_OBJ)) {
    return;
  }

  utils.addXhrInstrumentationHandler(handlerData => {
    if (core.getClient() !== client) {
      return;
    }

    const xhr = handlerData.xhr ;

    const sentryXhrData = xhr[utils.SENTRY_XHR_DATA_KEY];

    if (!sentryXhrData) {
      return;
    }

    const { method, request_headers: headers } = sentryXhrData;

    try {
      _xhrResponseHandler(options, xhr, method, headers);
    } catch (e) {
      debugBuild.DEBUG_BUILD && utils.logger.warn('Error while extracting response event form XHR response', e);
    }
  });
}
Wraps XMLHttpRequest to capture request and response data