From 05f19fbdd2e7954c01bdd2d7834233699e142563 Mon Sep 17 00:00:00 2001 From: Meghdad Date: Sun, 1 Jun 2025 23:27:34 +0330 Subject: [PATCH] add more debug print --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 7a21ded..4aa4056 100644 --- a/main.py +++ b/main.py @@ -27,7 +27,11 @@ def get_blackouts(bill_id) -> list: "to_date": to_date.strftime("%Y/%m/%d"), } response = requests.post(url, headers=headers, json=payload) - return response.json().get("data", []) + if response.ok: + return response.json().get("data", []) + else: + print(f"❌ Failed to get blackouts: {response.text}") + exit(1) def load_blackouts() -> dict: