Raise error if process fails in execute_live

This commit is contained in:
bom 2024-02-24 12:07:31 +01:00
parent afec1fdd0c
commit c5af5c9198

View file

@ -122,9 +122,11 @@ class ExecutionApi:
print(command) print(command)
else: else:
process = Popen(command, shell=shell) process = Popen(command, shell=shell)
outs, _ = process.communicate() outs, errs = process.communicate()
while outs is not None: while outs is not None:
stdout.buffer.write(outs) stdout.buffer.write(outs)
if errs is not None:
raise RuntimeError(f"Execute live '{command}' failed with code {process.returncode}\n{errs}")
class EnvironmentApi: class EnvironmentApi: