From 55573adc8734389ad3ea9f16fc0b280528320ec7 Mon Sep 17 00:00:00 2001 From: Samuel Vange <7166607+svange@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:29:29 -0800 Subject: [PATCH] fix: catching AWS client error to allow for no-infra testing in CI pipelines. --- openbrain/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openbrain/util.py b/openbrain/util.py index 2ee793c..0dff455 100644 --- a/openbrain/util.py +++ b/openbrain/util.py @@ -222,12 +222,13 @@ def _get_resource_from_central_infra(self, friendly_name): self._central_infra_outputs = { x["OutputKey"]: x["OutputValue"] for x in response["Stacks"][0]["Outputs"] } - except NoCredentialsError or ClientError: + except NoCredentialsError or ClientError as e: logger.warning( f"Can't find central infrastructure stack {self.INFRA_STACK_NAME} - to find resources from " f"friendly names. Please define all resource names in the environment OR define the central " f"infrastructure stack name in the environment and resource friendly names" ) + logger.warning(str(e)) # raise e return self._central_infra_outputs[friendly_name]