From 6b68a72befc2db42792077dd40cf06880466df1f Mon Sep 17 00:00:00 2001 From: Ward Van Heddeghem Date: Mon, 26 Feb 2024 19:14:09 +0100 Subject: [PATCH] Raise tempsiteerror at login when 5xx (part 3) --- src/mijnbib/login_handlers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mijnbib/login_handlers.py b/src/mijnbib/login_handlers.py index 0805b3a..5b37814 100644 --- a/src/mijnbib/login_handlers.py +++ b/src/mijnbib/login_handlers.py @@ -164,6 +164,10 @@ def _log_in(self): _log.debug(f"login (3) hint : {hint}") if response.status_code == 200: raise AuthenticationError("Login not accepted. Correct credentials?") + if response.status_code >= 500: # we've observed 500 + raise TemporarySiteError( + f"Expected status code 303 during log in. Got '{response.status_code}'" + ) if response.status_code != 303: raise IncompatibleSourceError( f"Expected status code 303 during log in. Got '{response.status_code}'",