Skip to content

Commit aba1ddd

Browse files
committed
Handle JSON decoding errors in _get_data function
1 parent d49abd9 commit aba1ddd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/plugins/test_sync_protocol.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ def _get_data(api_token, node_url):
5858
try:
5959
response = requests.get(node_url + API_ENDPOINT, headers=headers, timeout=5)
6060
if response.status_code == 200:
61-
return response.json()
61+
try:
62+
return response.json()
63+
except json.JSONDecodeError:
64+
pass
6265
except requests.RequestException:
6366
pass
6467
return ""

0 commit comments

Comments
 (0)