code: public static boolean isRecoverable(Throwable t) {
      if (t instanceof KeeperException) {
        KeeperException ex = (KeeperException) t;
        if (ex.code() == KeeperException.Code.CONNECTIONLOSS ||
            ex.code() == KeeperException.Code.OPERATIONTIMEOUT) {
          return true;
        }
      }
      return false;
    }
docs: Decides whether the given {@link Throwable throwable} is recoverable or not.
  Recoverable exceptions are defined as such:
  http://wiki.apache.org/hadoop/ZooKeeper/ErrorHandling
  
  @param t the {@link Throwable}
  @return  {@code true} if {@code t} is recoverable and {@code false} otherwise.