From: Roland Häder Date: Thu, 18 May 2023 01:54:45 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fa5af903b728f21dbe2536eb1d74b9072badcd83;p=fba.git 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) --- 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