Skip to content

Commit 10b94ca

Browse files
committed
Use dict to forward error
1 parent 3d93eaf commit 10b94ca

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

prometrix/auth.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ def _post_azure_token_endpoint(cls, config: PrometheusConfig):
6363
# Fallback to Azure Service Principal
6464
if not token:
6565
if config.azure_use_workload_id:
66-
logging.error(f"Could not open token file from {token_file}")
67-
return {}
66+
return {
67+
"ok": False,
68+
"reason": f"Could not open token file from {token_file}",
69+
}
6870
data = {
6971
"grant_type": "client_credentials",
7072
"client_id": config.azure_client_id,

0 commit comments

Comments
 (0)