From: Roland Häder Date: Fri, 9 Jun 2023 02:28:29 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=17e171972c342e8602accc250a8a921a694766bd;p=fba.git Continued: - catch BaseException (very generic catch, but wanted here) --- diff --git a/fba/commands.py b/fba/commands.py index 65ddb03..a14d878 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -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) diff --git a/fba/fba.py b/fba/fba.py index 49b1044..1020416 100644 --- a/fba/fba.py +++ b/fba/fba.py @@ -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!") diff --git a/fba/federation/mastodon.py b/fba/federation/mastodon.py index abbe8b8..3106065 100644 --- a/fba/federation/mastodon.py +++ b/fba/federation/mastodon.py @@ -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!") diff --git a/fba/federation/pleroma.py b/fba/federation/pleroma.py index 4c5d726..764209c 100644 --- a/fba/federation/pleroma.py +++ b/fba/federation/pleroma.py @@ -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!")