Skip to content

Commit

Permalink
Use dict to forward error
Browse files Browse the repository at this point in the history
  • Loading branch information
EppO committed Dec 12, 2023
1 parent 3d93eaf commit 10b94ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions prometrix/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ def _post_azure_token_endpoint(cls, config: PrometheusConfig):
# Fallback to Azure Service Principal
if not token:
if config.azure_use_workload_id:
logging.error(f"Could not open token file from {token_file}")
return {}
return {
"ok": False,
"reason": f"Could not open token file from {token_file}",
}
data = {
"grant_type": "client_credentials",
"client_id": config.azure_client_id,
Expand Down

0 comments on commit 10b94ca

Please sign in to comment.