Wrap the getbugs call in a try/except

This prevents a Bugzilla timeout from derailing the whole run

Signed-off-by: Ben Cotton <bcotton@fedoraproject.org>
This commit is contained in:
Ben Cotton 2022-08-18 13:38:26 -04:00
commit 7f8483bf11

View file

@ -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