From a9d98a6d0ccc032d160b1b548d26bbe7d6e2a83c Mon Sep 17 00:00:00 2001 From: bom Date: Sat, 24 Feb 2024 12:11:57 +0100 Subject: [PATCH] Use returncode to check if process failed --- src/main/python/ddadevops/infrastructure/infrastructure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index b5ab79e..a57977d 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -125,8 +125,8 @@ class ExecutionApi: 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}") + if process.returncode != 0: + raise RuntimeError(f"Execute live '{command}' failed with code {process.returncode}\nerrs: {errs}") class EnvironmentApi: