From 490a1d87fbe070ebc64054135d39f05311a8a800 Mon Sep 17 00:00:00 2001 From: Justin Barrett Date: Wed, 10 Sep 2025 22:55:03 -0400 Subject: [PATCH] Adding single search --- rorapi/common/matching_single_search.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rorapi/common/matching_single_search.py b/rorapi/common/matching_single_search.py index 045ee61..4af5cf4 100644 --- a/rorapi/common/matching_single_search.py +++ b/rorapi/common/matching_single_search.py @@ -246,12 +246,12 @@ def match_by_query(text, query, countries): chosen_candidate = None chosen_true = None results = query.execute() - except: - return "query error", None + except Exception as e: + return f"query error: {e}", None try: candidates = results.hits.hits - except: - return f"candidates error: {results}", None + except Exception as e: + return f"candidates error: {e}\n{results}", None if candidates: candidates = [c for c in candidates if c["_source"]["status"] == "active"] scored_candidates = [score(text, c) for c in candidates]