Skip to content

Commit

Permalink
Log subprocess output also with non-zero exit code.
Browse files Browse the repository at this point in the history
  • Loading branch information
petterreinholdtsen committed Jan 19, 2019
1 parent a7f2fed commit 2712ba8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utils/move_and_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ def run(cls, cmd, filepath=None, reprocess=False):
else:
logging.info("SKIP already existing file: %s", filepath)
return
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
try:
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as ex: # error code <> 0
logging.debug(ex.output.decode('utf-8'))
raise
logging.debug(output.decode('utf-8'))


Expand Down

0 comments on commit 2712ba8

Please sign in to comment.