From 7a10aeafc1a4943872229e415c35a09e05cbd8c2 Mon Sep 17 00:00:00 2001 From: Aberasturi Date: Mon, 9 Aug 2021 13:58:48 +0200 Subject: [PATCH] Error loading node status because JSONDecodeERROR Signed-off-by: Aberasturi --- server/anchor.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/server/anchor.py b/server/anchor.py index 2f0d3cc..375954e 100644 --- a/server/anchor.py +++ b/server/anchor.py @@ -628,12 +628,16 @@ async def validator_info(self): ret = [] for node in node_aliases: - reply = json.loads(node_data[node]) - if "result" not in reply: + try: + reply = json.loads(node_data[node]) + if "result" not in reply: + continue + data = reply["result"].get("data") + data["Node_info"]["Name"] = node + ret.append(data) + # Some of the nodes a not reachable. + except json.decoder.JSONDecodeError: continue - data = reply["result"].get("data") - data["Node_info"]["Name"] = node - ret.append(data) return ret @property