From 31bdf6a0e1c0c27692d7a7bee781bb317e67545b Mon Sep 17 00:00:00 2001 From: Jakob Schlyter Date: Sat, 14 Dec 2024 22:41:25 +0100 Subject: [PATCH] Raise exception if we have no token after initialization --- custom_components/polestar_api/pypolestar/polestar.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/custom_components/polestar_api/pypolestar/polestar.py b/custom_components/polestar_api/pypolestar/polestar.py index edde205..17cd375 100644 --- a/custom_components/polestar_api/pypolestar/polestar.py +++ b/custom_components/polestar_api/pypolestar/polestar.py @@ -65,8 +65,7 @@ async def async_init(self, verbose: bool = False) -> None: await self.auth.get_token() if self.auth.access_token is None: - self.logger.warning("No access token for %s", self.username) - return + raise PolestarAuthException(f"No access token for {self.username}") self.gql_session = await get_gql_session(self.gql_client)