Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pointless error handling. #121

Merged
merged 1 commit into from
Jun 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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