1 |
commit: f21b0d05feb942e814a94190b63e0b918f622bab |
2 |
Author: Rolf Eike Beer <eike <AT> sf-mail <DOT> de> |
3 |
AuthorDate: Sat May 29 08:29:56 2021 +0000 |
4 |
Commit: Rolf Eike Beer <eike <AT> sf-mail <DOT> de> |
5 |
CommitDate: Sat May 29 08:33:22 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/tatt.git/commit/?id=f21b0d05 |
7 |
|
8 |
output a proper error message if the bug does not exist |
9 |
|
10 |
Otherwise one would see the following misleading message: |
11 |
|
12 |
File "/usr/lib/python-exec/python3.8/tatt", line 155, in <module> |
13 |
response = response["bugs"][0] |
14 |
IndexError: list index out of range |
15 |
|
16 |
Signed-off-by: Rolf Eike Beer <eike <AT> sf-mail.de> |
17 |
|
18 |
scripts/tatt | 4 ++++ |
19 |
1 file changed, 4 insertions(+) |
20 |
|
21 |
diff --git a/scripts/tatt b/scripts/tatt |
22 |
index 7524c8b..7d0f378 100755 |
23 |
--- a/scripts/tatt |
24 |
+++ b/scripts/tatt |
25 |
@@ -152,6 +152,10 @@ if options.bugnum: |
26 |
if "message" in response: |
27 |
print(response["message"]) |
28 |
sys.exit(1) |
29 |
+ if len(response["bugs"]) == 0: |
30 |
+ print("bug " + options.bugnum + " not found in bugzilla") |
31 |
+ sys.exit(1) |
32 |
+ |
33 |
response = response["bugs"][0] |
34 |
if "KEYWORDREQ" in response["keywords"] or response["component"] == "Keywording": |
35 |
# This is a keywording bug: |