Detect and report GQL errors as exceptions

This commit is contained in:
DevilXD
2022-09-14 15:04:13 +02:00
parent 0dce936c2b
commit 560b8f4720

View File

@@ -916,6 +916,8 @@ class Twitch:
) as response:
response_json: JsonType = await response.json()
gql_logger.debug(f"GQL Response: {response_json}")
if "errors" in response_json and response_json["errors"]:
raise MinerException(f"GQL error: {response_json['errors']}")
return response_json
async def fetch_campaign(