From fa5af903b728f21dbe2536eb1d74b9072badcd83 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 18 May 2023 03:54:45 +0200 Subject: [PATCH] Continued: - variable 'peer' can be type of string in case or error, so let's gently abort here instead of running into error (catching exceptions isn't a proper flow-control) --- fetch_blocks.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fetch_blocks.py b/fetch_blocks.py index b241fa1..9ce2715 100644 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -288,7 +288,13 @@ for blocker, software in fba.c.fetchall(): print("WARNING: No valid response:", blocker); else: for peer in federation: + print("DEBUG: peer(),[]:", len(peer), type(peer)) + if (isinstance(peer, str) and peer == "error"): + print("WARNING: Cannot continue, maybe authentication required?", blocker) + break + blocked = peer["domain"].lower() + print("DEBUG: blocked:", blocked) if blocked.count("*") > 0: # GTS does not have hashes for obscured domains, so we have to guess it -- 2.39.5