From e612d7a10d19dac40f58bd6ba00eb10f3697d36d Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Thu, 18 Apr 2024 00:24:19 +0200 Subject: [PATCH] Check for data --- personal_data/fetchers/partisia_blockchain.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/personal_data/fetchers/partisia_blockchain.py b/personal_data/fetchers/partisia_blockchain.py index b43c948..a165cf3 100644 --- a/personal_data/fetchers/partisia_blockchain.py +++ b/personal_data/fetchers/partisia_blockchain.py @@ -40,7 +40,11 @@ class MpcBalance(Scraper): response = self.session.post(url, headers = headers, data=json.dumps(data)) response.raise_for_status() date = response.headers.get('last-modified') or response.headers.get('date') - return response.json(), date + json_data = response.json() + if json_data is None: + msg = 'No result data for ' + url + raise Exception(msg) + return json_data, date def determine_coins(self) -> list[dict]: data: dict = {'path':[]}