From 93fa58f9ee985c52182ef26a8b9e0433c9efee95 Mon Sep 17 00:00:00 2001 From: JGStew Date: Wed, 21 Aug 2024 17:09:02 -0400 Subject: [PATCH] improve error handling --- examples/baseline_by_relevance.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/baseline_by_relevance.py b/examples/baseline_by_relevance.py index f927cad..bc8ade0 100644 --- a/examples/baseline_by_relevance.py +++ b/examples/baseline_by_relevance.py @@ -37,8 +37,12 @@ def main(): for item in result: # print(item) tuple_items = item.split(", ") - baseline_components += f""" - """ + try: + baseline_components += f""" + """ + except IndexError: + print("ERROR: a component was missing a key item.") + continue # print(baseline_components)