diff options
author | 2021-05-29 10:29:56 +0200 | |
---|---|---|
committer | 2021-05-29 10:33:22 +0200 | |
commit | f21b0d05feb942e814a94190b63e0b918f622bab (patch) | |
tree | c790693d0ad83a388a4acf159c8416e04138c0f1 | |
parent | add a return code to the revdep test script (diff) | |
download | tatt-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-x | scripts/tatt | 4 |
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: |