new: Added error catching on ZMQ pull

pull/22/head
Hannah Ward 2017-07-26 14:39:04 +01:00
parent 25430a51ae
commit c2846fd5d9
No known key found for this signature in database
GPG Key ID: 6F3BAD60DE190290
1 changed files with 8 additions and 4 deletions

View File

@ -72,8 +72,12 @@ while True:
log.debug("Loaded successfully!")
# Push the package to TAXII
cli.push(pkg.to_xml().decode("utf-8"), "urn:stix.mitre.org:xml:1.1.1",
uri="http://{}/services/inbox".format(config["domain"]),
collection_names=["collection"])
try:
cli.push(pkg.to_xml().decode("utf-8"), "urn:stix.mitre.org:xml:1.1.1",
uri="http://{}/services/inbox".format(config["domain"]),
collection_names=["collection"])
log.info("Pushed!")
log.info("Pushed!")
except Exception as ex:
log.fatal("COULD NOT PUSH")
log.exception(ex)