From 86a001aa32886233c016c6c71e4dc95a2c951e32 Mon Sep 17 00:00:00 2001 From: Malte Juergens Date: Tue, 7 May 2024 14:52:04 +0200 Subject: [PATCH] Re-raise KeyError in `findOpenBugs` with unexpected JSON See #363 --- apis/bugzilla_api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apis/bugzilla_api.py b/apis/bugzilla_api.py index dbf33bbe..c96e38a3 100644 --- a/apis/bugzilla_api.py +++ b/apis/bugzilla_api.py @@ -156,7 +156,10 @@ def findOpenBugs(url, bugIDs): except Exception as e: raise Exception("Could not decode a bugzilla response as JSON: " + r.text) from e - return [b['id'] for b in j['bugs']] + try: + return [b['id'] for b in j['bugs']] + except KeyError as e: + raise Exception(j) from e def markFFVersionAffected(url, apikey, bugID, ff_version, affected):