Juniper/ansible-junos-stdlib — pull request #18 by vnitinv (2014-05-30 10:20:35+00:00)
Title: to handle ValueError

other way can be:

except Exception as err:
if isinstance(err, ValueError):
logging.error("unable to load config:{}".format(err.message))
elif err.rsp.find('.//ok') is None:
rpc_msg = err.rsp.findtext('.//error-message')
logging.error("unable to load config:{}".format(rpc_msg))
raise err