Skip to content

Commit

Permalink
Prevent failed call from causing unexpected exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanmarlor committed Nov 6, 2022
1 parent 5412b3a commit 9bdc6cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/foxess_em/fox/fox_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def _post_data(self, url: str, params: dict[str, str]) -> dict:
url, json=params, headers=self._token
)
except Exception as ex:
_LOGGER.error("Fox Cloud API error: %s", ex)
raise NoDataError(f"Fox Cloud API error: {ex}")

if response.status == 200:
result = await response.json(content_type=None)
Expand Down

0 comments on commit 9bdc6cf

Please sign in to comment.