@Override
  public void nodeDataChanged(String path) {
    if (!path.equals(pathToWatch)) {
      return;
    }
    try {
      if (!(ZKUtil.setWatchIfNodeExists(watcher, pathToWatch))) {
        deletedLatch.countDown();
      }
    } catch (KeeperException ex) {
      exception = ex;
      deletedLatch.countDown();
      LOG.error("Error when re-setting the watch on " + pathToWatch, ex);
    }
  }
Get the last exception which has occurred when re-setting the watch. Use hasException() to
check whether or not an exception has occurred.
@return The last exception observed when re-setting the watch.
hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/DeletionListener.java