handles ZooKeeperException, though it is naive.