From 337d9a6306adab21dc0eb28b7dbc030512018104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 5 Feb 2020 13:28:11 +0100 Subject: [PATCH] chg: More flexible when an event is in a weird state. --- examples/feed-generator/generate.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/feed-generator/generate.py b/examples/feed-generator/generate.py index 19ec4ce..8f73c4c 100755 --- a/examples/feed-generator/generate.py +++ b/examples/feed-generator/generate.py @@ -63,8 +63,12 @@ if __name__ == '__main__': counter = 1 total = len(events) for event in events: - e = misp.get_event(event.uuid, pythonify=True) - e_feed = e.to_feed(valid_distributions=valid_attribute_distributions, with_meta=True) + try: + e = misp.get_event(event.uuid, pythonify=True) + e_feed = e.to_feed(valid_distributions=valid_attribute_distributions, with_meta=True) + except Exception as e: + print(e, event.uuid) + continue if not e_feed: print(f'Invalid distribution {e.distribution}, skipping') continue