From df80ea4599585d17e03e64474f56a0371f0b7b02 Mon Sep 17 00:00:00 2001 From: Remus Lazar Date: Fri, 5 Jul 2024 13:46:17 +0000 Subject: [PATCH] refactor: Improve error handling and update logic in NissanCarwingsApiClient ensure that the NissanCarwingsApiUpdateTimeoutError is passed through the outer try/catch block. --- custom_components/nissan_carwings/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/nissan_carwings/api.py b/custom_components/nissan_carwings/api.py index 3050bd3..e55b187 100644 --- a/custom_components/nissan_carwings/api.py +++ b/custom_components/nissan_carwings/api.py @@ -161,6 +161,8 @@ async def async_update_data(self): f"carwings3.request_update() => Timeout after {PYCARWINGS_MAX_RESPONSE_ATTEMPTS} attempts x {PYCARWINGS_SLEEP}s; vin={response.vin}" ) raise NissanCarwingsApiUpdateTimeoutError + except NissanCarwingsApiUpdateTimeoutError: + raise except Exception as exception: raise NissanCarwingsApiClientError from exception