Skip to content

Commit

Permalink
Write offending script to stderr (#i530)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoPeng committed Feb 4, 2024
1 parent 23bd5e9 commit 644a36c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sos/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,11 @@ 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('\nError occured when executing the following script:\n\n{self.script}\n\n')

if so is not None and so != subprocess.DEVNULL:
so.close()
if se is not None and se != subprocess.DEVNULL:
Expand Down

0 comments on commit 644a36c

Please sign in to comment.