]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 18 May 2023 01:54:45 +0000 (03:54 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 18 May 2023 01:54:45 +0000 (03:54 +0200)
- 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

index b241fa18d38d076670acd2002ec7b7d07a602dbb..9ce27152832bd3e535714a8a8972b2092e63432d 100644 (file)
@@ -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