Skip to content

Commit

Permalink
Added a try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
guerrerotook committed Dec 29, 2024
1 parent 8141eb6 commit b091e51
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,15 @@ async def check_general_status(self, installation: Installation) -> SStatus:
await self._check_capabilities_token(installation)
response = await self._execute_request(content, "Status", installation)

raw_data = response["data"]["xSStatus"]
return SStatus(raw_data["status"], raw_data["timestampUpdate"])
if "errors" in response:
_LOGGER.error(response)
return SStatus(None, None)

if "data" in response:
raw_data = response["data"]["xSStatus"]
return SStatus(raw_data["status"], raw_data["timestampUpdate"])

return SStatus(None, None)

async def check_alarm_status(
self, installation: Installation, reference_id: str, timeout: int = 10
Expand Down

0 comments on commit b091e51

Please sign in to comment.