]> git.mxchange.org Git - fba.git/blobdiff - fba/networks/pleroma.py
Continued:
[fba.git] / fba / networks / pleroma.py
index 68ca8749ff8a84ae40d907863815dfb0d38720ef..73720f7ee6eef8def87b8973716b4cc14b771344 100644 (file)
@@ -54,8 +54,12 @@ def fetch_blocks(domain: str) -> list:
     logger.debug("domain='%s' - CALLED!", domain)
     domain_helper.raise_on(domain)
 
+    if not instances.is_registered(domain):
+        raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+
     blockdict = list()
     rows = None
+
     try:
         logger.debug("Fetching nodeinfo: domain='%s'", domain)
         rows = nodeinfo.fetch(domain, update_mode=False)
@@ -276,6 +280,9 @@ def fetch_blocks_from_about(domain: str) -> dict:
     logger.debug("domain='%s' - CALLED!", domain)
     domain_helper.raise_on(domain)
 
+    if not instances.is_registered(domain):
+        raise Exception(f"domain='{domain}' is not registered but function is invoked.")
+
     logger.debug("Fetching mastodon blocks from domain='%s'", domain)
     doc = None
     for path in ["/instance/about/index.html"]: