Skip to content

Commit 27044bc

Browse files
committed
add error logging
1 parent f07b33d commit 27044bc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

extensions.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,14 @@ def execute_command(cmd: List[str], cwd: Path, env: Dict[str, str] = os.environ)
117117
output = check_output(cmd, cwd=cwd.as_posix(), env=env)
118118
logging.info(output)
119119
except CalledProcessError as e:
120-
logging.info('\n'.join([f'{"-" * 20} ERROR {"-" * 20}', e.output or "", ]))
120+
if isinstance(e.output, bytes):
121+
output = e.output.decode("utf-8")
122+
elif isinstance(e.output, str):
123+
output = e.output
124+
elif e.output is None:
125+
output = ""
126+
else:
127+
output = str(e.output)
128+
129+
logging.info('\n'.join([f'{"-" * 20} ERROR {"-" * 20}', output or "", ]))
121130
raise e

0 commit comments

Comments
 (0)