Linux maintainer tooling and workflows
 help / color / mirror / Atom feed
From: Nicolas Schier <n.schier@avm.de>
To: tools@linux.kernel.org
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Subject: [PATCH b4] mbox: Exit with error code if no messages were found
Date: Thu, 25 Aug 2022 08:41:09 +0200	[thread overview]
Message-ID: <20220825064109.550092-1-n.schier@avm.de> (raw)

When mbox.main() is unable to retrieve any messages, some kind of error
happend (e.g. msgid has not been found).  Forward error state to the
parent process by exiting with exit code 1, to allow proper
handling.

Signed-off-by: Nicolas Schier <n.schier@avm.de>
---
 b4/mbox.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/b4/mbox.py b/b4/mbox.py
index 9a6ea9c..0d258da 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -755,7 +755,7 @@ def main(cmdargs):
 
     msgid, msgs = get_msgs(cmdargs)
     if not msgs:
-        return
+        sys.exit(1)
 
     if len(msgs) and cmdargs.checknewer:
         msgs = get_extra_series(msgs, direction=1, useproject=cmdargs.useproject)
-- 
2.37.2


             reply	other threads:[~2022-08-25  6:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25  6:41 Nicolas Schier [this message]
2022-10-17 14:02 ` [PATCH b4] mbox: Exit with error code if no messages were found Nicolas Schier
2022-10-18 14:23   ` Konstantin Ryabitsev
2022-10-18 14:49 ` Konstantin Ryabitsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220825064109.550092-1-n.schier@avm.de \
    --to=n.schier@avm.de \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@linux.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).