From 5e5b8ce200714be852ff96c29566fadf06df1790 Mon Sep 17 00:00:00 2001 From: Maarten de Waard Date: Wed, 28 Sep 2022 14:53:40 +0200 Subject: [PATCH] raise exceptions instead of logging them and then failing relatively silently --- helpers/kubernetes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpers/kubernetes.py b/helpers/kubernetes.py index 7f29ade..09fcc68 100644 --- a/helpers/kubernetes.py +++ b/helpers/kubernetes.py @@ -143,7 +143,7 @@ def store_kubernetes_secret(secret_dict, namespace, update=False): ) except FailToCreateError as ex: current_app.logger.info(f"Secret not created because of exception {ex}") - return + raise ex current_app.logger.info(f"Secret {verb} with api response: {api_response}") @@ -172,7 +172,7 @@ def store_kustomization(kustomization_template_filepath, app_slug): except FailToCreateError as ex: current_app.logger.info( f"Could not create {app_slug} Kustomization because of exception {ex}") - return False + raise ex current_app.logger.debug(f"Kustomization created with api response: {api_response}") return True @@ -202,7 +202,7 @@ def delete_kustomization(kustomization_name): except ApiException as ex: current_app.logger.info( f"Could not delete {kustomization_name} Kustomization because of exception {ex}") - return False + raise ex current_app.logger.debug(f"Kustomization deleted with api response: {api_response}") return api_response