Skip to content

Commit

Permalink
refactor: Improve error handling and update logic in NissanCarwingsAp…
Browse files Browse the repository at this point in the history
…iClient

ensure that the NissanCarwingsApiUpdateTimeoutError is passed through the outer try/catch block.
  • Loading branch information
remuslazar committed Jul 5, 2024
1 parent 9cbd5a3 commit df80ea4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/nissan_carwings/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit df80ea4

Please sign in to comment.