summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2021-05-29 10:29:56 +0200
committerRolf Eike Beer <eike@sf-mail.de>2021-05-29 10:33:22 +0200
commitf21b0d05feb942e814a94190b63e0b918f622bab (patch)
treec790693d0ad83a388a4acf159c8416e04138c0f1
parentadd a return code to the revdep test script (diff)
downloadtatt-f21b0d05feb942e814a94190b63e0b918f622bab.tar.gz
tatt-f21b0d05feb942e814a94190b63e0b918f622bab.tar.bz2
tatt-f21b0d05feb942e814a94190b63e0b918f622bab.zip
output a proper error message if the bug does not exist
Otherwise one would see the following misleading message: File "/usr/lib/python-exec/python3.8/tatt", line 155, in <module> response = response["bugs"][0] IndexError: list index out of range Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
-rwxr-xr-xscripts/tatt4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/tatt b/scripts/tatt
index 7524c8b..7d0f378 100755
--- a/scripts/tatt
+++ b/scripts/tatt
@@ -152,6 +152,10 @@ if options.bugnum:
if "message" in response:
print(response["message"])
sys.exit(1)
+ if len(response["bugs"]) == 0:
+ print("bug " + options.bugnum + " not found in bugzilla")
+ sys.exit(1)
+
response = response["bugs"][0]
if "KEYWORDREQ" in response["keywords"] or response["component"] == "Keywording":
# This is a keywording bug: