auth: added additioanl exception tracking, updated x10sa yaml

This commit is contained in:
appleb_m
2026-06-10 14:27:54 +02:00
committed by appleb_m
parent 860cedfa1a
commit 01a656d956
+6 -1
View File
@@ -47,6 +47,11 @@ def auth(base_url: str | None, cert_path: str | None) -> str:
"Cannot reach AareDAQ server (OS error). "
"Please check the server is running and your connection."
) from e
except Exception as e:
logger.error(f"Token request curl error: {e}")
raise RuntimeError(
"Cannot reach AareDAQ server (unknown error). "
)
if token_result.returncode != 0:
logger.error(f"Token curl exited {token_result.returncode}. stderr: {token_result.stderr[:500]}")
@@ -66,7 +71,7 @@ def auth(base_url: str | None, cert_path: str | None) -> str:
token = response_json.get("access_token")
if not token or not isinstance(token, str):
logger.error(f"Missing access_token. Keys: {list(response_json.keys())}")
logger.error(f"Missing access_token. Keys: {list(response_json.keys())}. Server response {response_json}")
raise RuntimeError(
"Authentication failed (missing token in server response). "
"The server may be starting up."