Handle JSON decoding errors in _get_data function

This commit is contained in:
Jokob @NetAlertX
2026-03-08 07:57:52 +00:00
parent d49abd9d02
commit aba1ddd3df

View File

@@ -58,7 +58,10 @@ def _get_data(api_token, node_url):
try:
response = requests.get(node_url + API_ENDPOINT, headers=headers, timeout=5)
if response.status_code == 200:
return response.json()
try:
return response.json()
except json.JSONDecodeError:
pass
except requests.RequestException:
pass
return ""