Skip to content

Commit

Permalink
cloudapi: add AirzoneTimeout exception
Browse files Browse the repository at this point in the history
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
  • Loading branch information
Noltari committed Oct 12, 2024
1 parent 3826d24 commit d9b5ee7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aioairzone_cloud/cloudapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ async def api_request(
raise TooManyRequests(err) from err

raise AirzoneCloudError(err) from err
except TimeoutError as err:
raise TimeoutError(err) from err

_LOGGER.debug("aiohttp response: %s", resp_json)

Expand Down
4 changes: 4 additions & 0 deletions aioairzone_cloud/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class AirzoneCloudError(Exception):
"""Base class for Airzone Cloud errors."""


class AirzoneTimeout(AirzoneCloudError):
"""Exception raised when API times out."""


class APIError(AirzoneCloudError):
"""Exception raised when API fails."""

Expand Down

0 comments on commit d9b5ee7

Please sign in to comment.