From 560b8f4720e08e1422fe2fdca2ab59cdd8178d95 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Wed, 14 Sep 2022 15:04:13 +0200 Subject: [PATCH] Detect and report GQL errors as exceptions --- twitch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/twitch.py b/twitch.py index d48d66a..5de3a9d 100644 --- a/twitch.py +++ b/twitch.py @@ -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(