From c2846fd5d9809dc81ecb4f52fdaa65419995c751 Mon Sep 17 00:00:00 2001 From: Hannah Ward Date: Wed, 26 Jul 2017 14:39:04 +0100 Subject: [PATCH] new: Added error catching on ZMQ pull --- scripts/push_published_to_taxii.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/push_published_to_taxii.py b/scripts/push_published_to_taxii.py index 62be789..78f3888 100644 --- a/scripts/push_published_to_taxii.py +++ b/scripts/push_published_to_taxii.py @@ -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)