mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-07 01:54:04 +00:00
Log errors on docker run/exec failure
This commit is contained in:
@@ -47,6 +47,9 @@ class DockerRunner:
|
||||
exec_result = container.exec_run(cmd)
|
||||
output = exec_result.output.decode().rstrip()
|
||||
assert isinstance(output, str)
|
||||
LOGGER.debug(f"Command output: {output}")
|
||||
assert exec_result.exit_code == 0, f"Command: `{cmd}` failed"
|
||||
if exec_result.exit_code != 0:
|
||||
LOGGER.error(f"Command output:\n{output}")
|
||||
raise AssertionError(f"Command: `{cmd}` failed")
|
||||
else:
|
||||
LOGGER.debug(f"Command output:\n{output}")
|
||||
return output
|
||||
|
Reference in New Issue
Block a user