]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 9 Jun 2023 02:28:29 +0000 (04:28 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 9 Jun 2023 02:28:29 +0000 (04:28 +0200)
- catch BaseException (very generic catch, but wanted here)

fba/commands.py
fba/fba.py
fba/federation/mastodon.py
fba/federation/pleroma.py

index 65ddb03f80ad5a07335b88185ccbc9fa26cd91c0..a14d8783419a327e964327f0fd5c16619a34cae3 100644 (file)
@@ -243,7 +243,7 @@ def fetch_blocks(args: argparse.Namespace):
 
                 # DEBUG: print("DEBUG: Committing changes ...")
                 fba.connection.commit()
-            except Exception as exception:
+            except BaseException as exception:
                 print(f"ERROR: blocker='{blocker}',software='{software}',exception[{type(exception)}]:'{str(exception)}'")
         else:
             print("WARNING: Unknown software:", blocker, software)
index 49b1044a091e2a76c78e57fec3b1f22c94f42bd8..10204167426ab1d9a7dddc095439dbc9ebb5e288 100644 (file)
@@ -761,8 +761,6 @@ def find_domains(tag: bs4.element.Tag) -> list:
     # DEBUG: print(f"DEBUG: tag[]={type(tag)} - CALLED!")
     if not isinstance(tag, bs4.element.Tag):
         raise ValueError(f"Parameter tag[]={type(tag)} is not type of bs4.element.Tag")
-    elif not isinstance(tag, bs4.element.Tag):
-        raise KeyError("Cannot find table with instances!")
     elif len(tag.select("tr")) == 0:
         raise KeyError("No table rows found in table!")
 
index abbe8b8fb9ebcda6fb0efeb6904fc8d789e5e917..31060654b1dd3e761413ef356ef8635d96ff90d9 100644 (file)
@@ -256,7 +256,7 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str):
 
         # DEBUG: print("DEBUG: Committing changes ...")
         fba.connection.commit()
-    except Exception as exception:
+    except BaseException as exception:
         print(f"ERROR: domain='{domain}',software='mastodon',exception[{type(exception)}]:'{str(exception)}'")
 
     # DEBUG: print("DEBUG: EXIT!")
index 4c5d72656e3f9aa0c946e690874530258360f5c1..764209c918eaddbd93ea37818f4a4810969f63e9 100644 (file)
@@ -194,7 +194,7 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str):
                             entry["reason"] = reason["reason"]
 
         fba.connection.commit()
-    except Exception as exception:
+    except BaseException as exception:
         print(f"ERROR: domain='{domain}',software='pleroma',exception[{type(exception)}]:'{str(exception)}'")
 
     # DEBUG: print("DEBUG: EXIT!")