Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
IceBotYT committed Jan 26, 2025
1 parent 7890633 commit 29d927e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/nice_go/nice_go_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,18 @@ async def _poll_events_ws(self) -> None:
while True:
await self._events_ws.poll()

async def _check_response_errors(self, response: dict[str, Any]) -> bool:
async def _check_response_errors(self, response: dict[str, Any]) -> None:
"""Checks a GraphQL response for errors, namely for expired tokens.
Args:
response (dict[str, Any]): The response to check.
Raises:
AuthFailedError: If the ID token is expired.
ApiError: If an API error occurs.
Returns:
If the response is OK or not.
None
"""

if errors := response.get("errors"):
Expand All @@ -386,8 +393,6 @@ async def _check_response_errors(self, response: dict[str, Any]) -> bool:
raise AuthFailedError(error)
raise ApiError(error)

return True

@retry(
wait=wait_random_exponential(multiplier=1, min=1, max=10),
retry=_RetryIfReconnect()
Expand Down

0 comments on commit 29d927e

Please sign in to comment.