Skip to content

Commit

Permalink
WIP: error message function
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaso committed Mar 30, 2024
1 parent 8618992 commit a25bff4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vault_oidc_ssh_cert_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class VoscaError(Exception):
pass


def _set_error_message(title: str, message: str) -> None:
print(f"::error title={title}::{message}")


def _determine_audience(input_audience: str, vault_server: str) -> str:
if input_audience:
return input_audience
Expand Down Expand Up @@ -41,7 +45,7 @@ def _issue_vault_token(
response = requests.post(login_url, data=payload, timeout=10)
response.raise_for_status()
except requests.exceptions.HTTPError as http_error:
print(f"::error title=Vault login error::{str(http_error)}")
_set_error_message("Vault login error", str(http_error))
raise VoscaError from http_error

vault_token: str = response.json()["auth"]["client_token"]
Expand Down

0 comments on commit a25bff4

Please sign in to comment.