From 9aeb02f462ba9d50b65f6e795b6e329f1793c2b9 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Tue, 18 Jul 2023 10:26:52 -0600 Subject: [PATCH] bridge state: change 'Server disconnected' to BAD_CREDENTIALS instead of UNKNOWN_ERROR Signed-off-by: Sumner Evans --- linkedin_matrix/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linkedin_matrix/user.py b/linkedin_matrix/user.py index 714d523..9067ee2 100644 --- a/linkedin_matrix/user.py +++ b/linkedin_matrix/user.py @@ -6,7 +6,7 @@ import asyncio import time -from aiohttp.client_exceptions import TooManyRedirects +from aiohttp.client_exceptions import ServerConnectionError, TooManyRedirects from linkedin_messaging import URN, LinkedInMessaging from linkedin_messaging.api_objects import ( Conversation, @@ -199,7 +199,7 @@ async def load_session( try: self.user_profile_cache = await self.client.get_user_profile() - except TooManyRedirects as e: + except (TooManyRedirects, ServerConnectionError) as e: await self.push_bridge_state(BridgeStateEvent.BAD_CREDENTIALS, message=str(e)) return False except Exception as e: