From ddd178cee9560a7ea2af4ae9b5e289647870e0fc Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 3 Jun 2024 09:49:55 +0100 Subject: [PATCH] better error message --- spinnman/spalloc/session.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spinnman/spalloc/session.py b/spinnman/spalloc/session.py index b58c7b01b..cb73dc77e 100644 --- a/spinnman/spalloc/session.py +++ b/spinnman/spalloc/session.py @@ -238,7 +238,10 @@ def renew(self) -> JsonObject: self.__login_form_url, r.status_code) m = csrf_matcher.search(r.text) if not m: - raise SpallocException("could not establish temporary session") + raise SpallocException( + "Could not establish temporary session to " + f"{self._service_url} for user {self.__username} " + f"with a {len(self.__password)} character password") csrf = m.group(1) session = r.cookies[_SESSION_COOKIE]