Detect and report GQL errors as exceptions
This commit is contained in:
1 parent
0dce936c2b
commit
560b8f4720
1 file changed
+2
@@ -916,6 +916,8 @@ class Twitch:
|
|||||||
) as response:
|
) as response:
|
||||||
response_json: JsonType = await response.json()
|
response_json: JsonType = await response.json()
|
||||||
gql_logger.debug(f"GQL Response: {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
|
return response_json
|
||||||
|
|
||||||
async def fetch_campaign(
|
async def fetch_campaign(
|
||||||
|
|||||||
Reference in new issue
Block a user