index.js
function diagnoseIt(error, diagnose) {
    // The browser reports being offline, blame the problem on this.
    if (("onLine" in navigator) && !navigator.onLine) {
      throw new BrowserOfflineError(error);
    }

    var serverURL = diagnose.serverURL;
    var check;
    // If the user gave us a server URL to check whether the server is up at
    // all, use it. If that failed, then we need to check the connection. If we
    // do not have a server URL, then we need to check the connection right
    // away.
    if (serverURL) {
      // eslint-disable-next-line no-use-before-define
      check = ajax({ url: dedupURL(normalizeURL(serverURL)) })
        .catch(function failed() {
          return connectionCheck(error, diagnose);
        });
    }
    else {
      check = connectionCheck(error, diagnose);
    }

    return check.then(function success() {
      // All of our checks passed... and we have no tries left, so just rethrow
      // what we would have thrown in the first place.
      throw error;
    });
  }
function diagnoseIt(error, diagnose) {
    // The browser reports being offline, blame the problem on this.
    if (("onLine" in navigator) && !navigator.onLine) {
      throw new BrowserOfflineError(error);
    }

    var serverURL = diagnose.serverURL;
    var check;
    // If the user gave us a server URL to check whether the server is up at
    // all, use it. If that failed, then we need to check the connection. If we
    // do not have a server URL, then we need to check the connection right
    // away.
    if (serverURL) {
      // eslint-disable-next-line no-use-before-define
      check = ajax({ url: dedupURL(normalizeURL(serverURL)) })
        .catch(function failed() {
          return connectionCheck(error, diagnose);
        });
    }
    else {
      check = connectionCheck(error, diagnose);
    }

    return check.then(function success() {
      // All of our checks passed... and we have no tries left, so just rethrow
      // what we would have thrown in the first place.
      throw error;
    });
  }
function diagnoseIt ( error , diagnose ) { // The browser reports being offline, blame the problem on this. if ( ( "onLine" in navigator ) && ! navigator . onLine ) { throw new BrowserOfflineError ( error ) ; } var serverURL = diagnose . serverURL ; var check ; // If the user gave us a server URL to check whether the server is up at // all, use it. If that failed, then we need to check the connection. If we // do not have a server URL, then we need to check the connection right // away. if ( serverURL ) { // eslint-disable-next-line no-use-before-define check = ajax ( { url : dedupURL ( normalizeURL ( serverURL ) ) } ) . catch ( function failed ( ) { return connectionCheck ( error , diagnose ) ; } ) ; } else { check = connectionCheck ( error , diagnose ) ; } return check . then ( function success ( ) { // All of our checks passed... and we have no tries left, so just rethrow // what we would have thrown in the first place. throw error ; } ) ; }
This is called when our tries all failed. This function attempts to figure out where the issue is.
This is called when our tries all failed . This function attempts to figure out where the issue is .