zookeeper.py: proper exception handling added.