add clearer error message

This commit is contained in:
2023-08-02 14:19:25 +01:00
parent 49e73c025a
commit b08b8e0e66

View File

@ -63,7 +63,7 @@ async def main():
print("Channel is not yet indexed. Waiting for " + str((await response.json())["retry_after"]) + "s as requested by the Discord API") print("Channel is not yet indexed. Waiting for " + str((await response.json())["retry_after"]) + "s as requested by the Discord API")
await asyncio.sleep((await response.json())["retry_after"]) await asyncio.sleep((await response.json())["retry_after"])
except KeyError: except KeyError:
sys.exit("Unexpected JSON response received from Discord. Actual JSON response: " + json.dumps(await response.json(), indent=4)) sys.exit("Unexpected JSON response received from Discord after trying to search for messages. Actual JSON response: " + json.dumps(await response.json(), indent=4))
# if the batch is not empty, adding the messages in batch to the list of messages to be deleted # if the batch is not empty, adding the messages in batch to the list of messages to be deleted
if batch: if batch: