Skip to content

Commit

Permalink
Merge pull request #121 from BaQs/api_cleanup_get_page_list
Browse files Browse the repository at this point in the history
Remove pointless error handling.
  • Loading branch information
RenierM26 authored Jun 25, 2023
2 parents 0ef9b2c + 828c206 commit 7db7f00
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions pyezviz/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,6 @@ def _api_get_pagelist(

raise HTTPError from err

if not req.text:
raise PyEzvizError("No data")

try:
json_output = req.json()

Expand All @@ -309,19 +306,7 @@ def _api_get_pagelist(
)
return self._api_get_pagelist(page_filter, json_key, max_retries + 1)

if json_key is None:
json_result = json_output
else:
json_result = json_output[json_key]

if not json_result:
# session is wrong, need to relogin
self.login()
_LOGGER.warning(
"Impossible to load the devices, here is the returned response: %s",
str(req.text),
)
return self._api_get_pagelist(page_filter, json_key, max_retries + 1)
json_result = json_output if not json_key else json_output[json_key]

return json_result

Expand Down

0 comments on commit 7db7f00

Please sign in to comment.