code: private boolean handleError(C4Error c4err) {
          // If this is a transient error, or if I'm continuous and the error might go away with a change
          // in network (i.e. network down, hostname unknown), then go offline and retry later.
          final boolean isTransient = C4Replicator.mayBeTransient(c4err) ||
              ((c4err.getDomain() == C4Constants.ErrorDomain.WEB_SOCKET) &&
                  (c4err.getCode() == C4WebSocketCloseCode.kWebSocketCloseUserTransient));
  
          final boolean isNetworkDependent = C4Replicator.mayBeNetworkDependent(c4err);
          if (!isTransient && !(config.isContinuous() && isNetworkDependent)) {
              return false; // nope, this is permanent
          }
          if (!config.isContinuous() && retryCount >= MAX_ONE_SHOT_RETRY_COUNT) {
              return false; //too many retries
          }
  
          clearRepl();
  
          if (!isTransient) {
              Log.i(DOMAIN, "%s: Network error (%s); will retry when network changes...", this, c4err);
          }
          else {
              // On transient error, retry periodically, with exponential backoff:
              final int delay = retryDelay(++retryCount);
              Log.i(DOMAIN, "%s: Transient error (%s); will retry in %d sec...", this, c4err, delay);
              handler.schedule(
                  new Runnable() {
                      @Override
                      public void run() {
                          retry();
                      }
                  },
                  delay,
                  TimeUnit.SECONDS);
          }
  
          // Also retry when the network changes:
          startReachabilityObserver();
          return true;
      }
docs: - (bool) handleError: (C4Error)c4err