X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=fba%2Fcommands.py;h=401f6a4701bc089f3b8f47c02ded8125e10a6d83;hb=dbffa1a7bd8b060822a9acb24fff2934752d4856;hp=d8917de89919700bc135c7dc7088de402eaf988a;hpb=55951df9798a5735cb167f24256cdb60d841a79c;p=fba.git diff --git a/fba/commands.py b/fba/commands.py index d8917de..401f6a4 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -96,7 +96,7 @@ def fetch_bkali(args: argparse.Namespace): # DEBUG: print(f"DEBUG: Adding domain='{entry['domain']}' ...") domains.append(entry["domain"]) - except (requests.exceptions.Timeout, requests.exceptions.ConnectionError, UnicodeEncodeError) as exception: + except network.exceptions as exception: print(f"ERROR: Cannot fetch graphql,exception[{type(exception)}]:'{str(exception)}'") sys.exit(255) @@ -109,7 +109,7 @@ def fetch_bkali(args: argparse.Namespace): try: print(f"INFO: Fetching instances from domain='{domain}' ...") federation.fetch_instances(domain, None, None, inspect.currentframe().f_code.co_name) - except (requests.exceptions.Timeout, requests.exceptions.ConnectionError, UnicodeEncodeError) as exception: + except network.exceptions as exception: print(f"WARNING: Exception '{type(exception)}' during fetching instances from domain='{domain}'") instances.update_last_error(domain, exception) @@ -206,6 +206,7 @@ def fetch_blocks(args: argparse.Namespace): searchres = fba.cursor.fetchone() + print(f"DEBUG: searchres[]='{type(searchres)}'") if searchres is None: print(f"WARNING: Cannot deobsfucate blocked='{blocked}' - SKIPPED!") continue @@ -221,6 +222,7 @@ def fetch_blocks(args: argparse.Namespace): searchres = fba.cursor.fetchone() + print(f"DEBUG: searchres[]='{type(searchres)}'") if searchres is None: print(f"WARNING: Cannot deobsfucate blocked='{blocked}' - SKIPPED!") continue @@ -322,7 +324,7 @@ def fetch_cs(args: argparse.Namespace): try: print(f"INFO: Fetching instances from domain='{row['domain']}' ...") federation.fetch_instances(row["domain"], 'chaos.social', None, inspect.currentframe().f_code.co_name) - except (requests.exceptions.Timeout, requests.exceptions.ConnectionError, UnicodeEncodeError) as exception: + except network.exceptions as exception: print(f"WARNING: Exception '{type(exception)}' during fetching instances from domain='{row['domain']}'") instances.update_last_error(row["domain"], exception) @@ -370,7 +372,7 @@ def fetch_fba_rss(args: argparse.Namespace): try: print(f"INFO: Fetching instances from domain='{domain}' ...") federation.fetch_instances(domain, None, None, inspect.currentframe().f_code.co_name) - except (requests.exceptions.Timeout, requests.exceptions.ConnectionError, UnicodeEncodeError) as exception: + except network.exceptions as exception: print(f"WARNING: Exception '{type(exception)}' during fetching instances from domain='{domain}'") instances.update_last_error(domain, exception) @@ -423,7 +425,7 @@ def fetch_fbabot_atom(args: argparse.Namespace): try: print(f"INFO: Fetching instances from domain='{domain}' ...") federation.fetch_instances(domain, None, None, inspect.currentframe().f_code.co_name) - except (requests.exceptions.Timeout, requests.exceptions.ConnectionError, UnicodeEncodeError) as exception: + except network.exceptions as exception: print(f"WARNING: Exception '{type(exception)}' during fetching instances from domain='{domain}'") instances.update_last_error(domain, exception) @@ -437,7 +439,7 @@ def fetch_instances(args: argparse.Namespace): try: print(f"INFO: Fetching instances from args.domain='{args.domain}' ...") federation.fetch_instances(args.domain, None, None, inspect.currentframe().f_code.co_name) - except (requests.exceptions.Timeout, requests.exceptions.ConnectionError, UnicodeEncodeError) as exception: + except network.exceptions as exception: print(f"WARNING: Exception '{type(exception)}' during fetching instances from args.domain='{args.domain}'") instances.update_last_error(args.domain, exception) return @@ -462,7 +464,7 @@ def fetch_instances(args: argparse.Namespace): try: print(f"INFO: Fetching instances for instance '{row[0]}' ('{row[2]}') of origin='{row[1]}',nodeinfo_url='{row[3]}'") federation.fetch_instances(row[0], row[1], row[2], inspect.currentframe().f_code.co_name, row[3]) - except (requests.exceptions.Timeout, requests.exceptions.ConnectionError, UnicodeEncodeError) as exception: + except network.exceptions as exception: print(f"WARNING: Exception '{type(exception)}' during fetching instances from domain='{row[0]}'") instances.update_last_error(row[0], exception) @@ -495,7 +497,7 @@ def fetch_federater(args: argparse.Namespace): try: print(f"INFO: Fetching instances for instane='{row['#domain']}' ...") federation.fetch_instances(row["#domain"], None, None, inspect.currentframe().f_code.co_name) - except (requests.exceptions.Timeout, requests.exceptions.ConnectionError, UnicodeEncodeError) as exception: + except network.exceptions as exception: print(f"WARNING: Exception '{type(exception)}' during fetching instances from domain='{row['#domain']}'") instances.update_last_error(row["#domain"], exception)