aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-02-11 12:00:47 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-02-11 12:00:47 -0500
commitea55cc54be17c478e7307f8d4eb640988d7822f9 (patch)
tree9f3c29af9aec7f102d5df6cb8e28e98cd30232b4
parent172aed2891338710d37f9145093121453196b5b3 (diff)
downloadkorg-helpers-ea55cc54be17c478e7307f8d4eb640988d7822f9.tar.gz
Show friendlier errors for some failures
We're already returning Nones when something isn't doing the right thing, but we aren't properly checking for them. This fixes two of the reported cases. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-xget-lore-mbox.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/get-lore-mbox.py b/get-lore-mbox.py
index db494d8..63f8838 100755
--- a/get-lore-mbox.py
+++ b/get-lore-mbox.py
@@ -593,6 +593,9 @@ def main(cmdargs):
if not cmdargs.msgid:
logger.debug('Getting Message-ID from stdin')
msgid = get_msgid_from_stdin()
+ if msgid is None:
+ logger.error('Unable to find a valid message-id in stdin.')
+ sys.exit(1)
else:
msgid = cmdargs.msgid
@@ -603,7 +606,10 @@ def main(cmdargs):
if mboxfile and cmdargs.checknewer:
get_newest_series(mboxfile, cmdargs)
- if mboxfile and cmdargs.amready:
+ if mboxfile is None:
+ return
+
+ if cmdargs.amready:
# Move it into -thread
threadmbox = '%s-thread' % mboxfile
os.rename(mboxfile, threadmbox)