From 7f8483bf11b3c75257b553fb3a9deeffc1705580 Mon Sep 17 00:00:00 2001 From: Ben Cotton Date: Thu, 18 Aug 2022 13:38:26 -0400 Subject: [PATCH] Wrap the getbugs call in a try/except This prevents a Bugzilla timeout from derailing the whole run Signed-off-by: Ben Cotton --- find_inactive_packagers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/find_inactive_packagers.py b/find_inactive_packagers.py index aa8c26f..04dd487 100644 --- a/find_inactive_packagers.py +++ b/find_inactive_packagers.py @@ -230,7 +230,12 @@ def cli(ctx, privacy): continue ids = [bug.bug_id for bug in bugs] user_comments = [] - for bug in bzclient.getbugs(ids): + try: + bzbugs = bzclient.getbugs(ids) + except Exception: + logging.error(f'Error while retrieving Bugzilla comments for user {username}') + continue + for bug in bzbugs: user_comments.extend([com for com in bug.longdescs if com['creator_id'] == bzuser.userid]) if not user_comments: continue