Skip to content

Commit

Permalink
fix error is optional (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
edenhaus authored Jun 29, 2022
1 parent 6d740f2 commit 263a0ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions deebot_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ async def get_devices(self) -> list[DeviceInfo]:
else:
_LOGGER.debug("Skipping device as it is not supported: %s", device)
return devices
_LOGGER.error("Failed to get devices")
raise ApiError(f"failure {resp['error']} ({resp['errno']}) on getting devices")
_LOGGER.error("Failed to get devices: %s", resp)
raise ApiError(
f"failure {resp.get('error', '')} ({resp.get('errno', '')}) on getting devices"
)

async def get_product_iot_map(self) -> dict[str, Any]:
"""Get product iot map."""
Expand Down

0 comments on commit 263a0ad

Please sign in to comment.