From ffeac9cb300a3e247c48598649c5118014a8a4a2 Mon Sep 17 00:00:00 2001 From: Gao Wang Date: Sun, 4 Feb 2024 10:00:30 -0500 Subject: [PATCH] Further address comment on #1530 --- src/sos/actions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sos/actions.py b/src/sos/actions.py index 9f9ee538a..dd624ef71 100644 --- a/src/sos/actions.py +++ b/src/sos/actions.py @@ -590,6 +590,9 @@ def run(self, **kwargs): p = subprocess.Popen(cmd, shell=True, stderr=se, stdout=so) ret = p.wait() + if ret != 0: + # write an error message to stderr + se.write(f'\nError occured when executing the following code chunk, saved to script:\n{debug_script_file}\n\n') if so is not None and so != subprocess.DEVNULL: so.close()