From 6e4c184ee6ece7157f1a300eba7436ff92700940 Mon Sep 17 00:00:00 2001 From: Tuen Lee Date: Wed, 3 Jan 2024 09:38:35 +0100 Subject: [PATCH] raise error exception on polestarApi --- custom_components/polestar_api/pypolestar/polestar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/polestar_api/pypolestar/polestar.py b/custom_components/polestar_api/pypolestar/polestar.py index 4b82fa3..8b24017 100644 --- a/custom_components/polestar_api/pypolestar/polestar.py +++ b/custom_components/polestar_api/pypolestar/polestar.py @@ -180,7 +180,8 @@ async def get_graph_ql(self, params: dict): error_message = resultData['errors'][0]['message'] if error_message == "User not authenticated": raise PolestarNotAuthorizedException("Unauthorized Exception") - _LOGGER.error(error_message) + _LOGGER.error(resultData.get('errors')) + raise PolestarApiException(error_message) _LOGGER.debug(resultData) return resultData