mirror of
https://github.com/frozenpandaman/s3s.git
synced 2026-08-28 13:24:45 -05:00
catch graphql query errors with a nice message
This commit is contained in:
4
s3s.py
4
s3s.py
@@ -255,6 +255,10 @@ def fetch_json(which, separate=False, exportall=False, specific=False, numbers_o
|
||||
query1_resp = json.loads(query1.text)
|
||||
swim()
|
||||
|
||||
if not query1_resp.get("data"): # catch error
|
||||
print("\nSomething's wrong with one of the query hashes. Ensure s3s is up-to-date, and if this message persists, please open an issue on GitHub.")
|
||||
sys.exit(1)
|
||||
|
||||
# ink battles - latest 50 of any type
|
||||
if "latestBattleHistories" in query1_resp["data"]:
|
||||
for battle_group in query1_resp["data"]["latestBattleHistories"]["historyGroups"]["nodes"]:
|
||||
|
||||
Reference in New Issue
Block a user