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: