From fd69fa04c66d5fc9da6d1ee53c79d01a65bc5259 Mon Sep 17 00:00:00 2001 From: Andreas Olsson Date: Sat, 30 Mar 2024 10:23:05 +0100 Subject: [PATCH] WIP: Proper exception --- vault_oidc_ssh_cert_action.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vault_oidc_ssh_cert_action.py b/vault_oidc_ssh_cert_action.py index 5a51edc..ddfd423 100644 --- a/vault_oidc_ssh_cert_action.py +++ b/vault_oidc_ssh_cert_action.py @@ -6,6 +6,10 @@ import requests +class VoscaError(Exception): + pass + + def _determine_audience(input_audience: str, vault_server: str) -> str: if input_audience: return input_audience @@ -69,7 +73,7 @@ def github_vault_auth() -> None: ) except requests.exceptions.HTTPError as http_error: print(http_error.response.json()) - raise SystemExit(1) from http_error + raise VoscaError from http_error print(f"::add-mask::{vault_token}") with open(os.environ["GITHUB_OUTPUT"], mode="a", encoding="utf-8") as ghof: