From c5af5c9198f7953f32153b82ed70b3746c3d9465 Mon Sep 17 00:00:00 2001 From: bom Date: Sat, 24 Feb 2024 12:07:31 +0100 Subject: [PATCH] Raise error if process fails in execute_live --- src/main/python/ddadevops/infrastructure/infrastructure.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 48b24c9..b5ab79e 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -122,9 +122,11 @@ class ExecutionApi: print(command) else: process = Popen(command, shell=shell) - outs, _ = process.communicate() + outs, errs = process.communicate() while outs is not None: stdout.buffer.write(outs) + if errs is not None: + raise RuntimeError(f"Execute live '{command}' failed with code {process.returncode}\n{errs}") class EnvironmentApi: