# DEBUG: print(f"DEBUG: Did not update any rows: blocker='{blocker}',blocked='{blocked}',block_level='{block_level}',reason='{reason}' - EXIT!")
return
- except BaseException as exc:
- print(f"ERROR: failed SQL query: reason='{reason}',blocker='{blocker}',blocked='{blocked}',block_level='{block_level}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: failed SQL query: reason='{reason}',blocker='{blocker}',blocked='{blocked}',block_level='{block_level}',exception[{type(exception)}]:'{str(exception)}'")
sys.exit(255)
# DEBUG: print("DEBUG: EXIT!")
# DEBUG: print(f"DEBUG: Did not update any rows: blocker='{blocker}',blocked='{blocked}',block_level='{block_level}' - EXIT!")
return
- except BaseException as exc:
- print(f"ERROR: failed SQL query: blocker='{blocker}',blocked='{blocked}',block_level='{block_level}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: failed SQL query: blocker='{blocker}',blocked='{blocked}',block_level='{block_level}',exception[{type(exception)}]:'{str(exception)}'")
sys.exit(255)
# DEBUG: print("DEBUG: EXIT!")
time.time()
),
)
- except BaseException as exc:
- print(f"ERROR: failed SQL query: blocker='{blocker}',blocked='{blocked}',reason='{reason}',block_level='{block_level}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: failed SQL query: blocker='{blocker}',blocked='{blocked}',reason='{reason}',block_level='{block_level}',exception[{type(exception)}]:'{str(exception)}'")
sys.exit(255)
# DEBUG: print("DEBUG: EXIT!")
# DEBUG: print(f"DEBUG: Adding domain='{entry['domain']}' ...")
domains.append(entry["domain"])
- except BaseException as exc:
- print(f"ERROR: Cannot fetch graphql,exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: Cannot fetch graphql,exception[{type(exception)}]:'{str(exception)}'")
sys.exit(255)
# DEBUG: print(f"DEBUG: domains()={len(domains)}")
# DEBUG: print("DEBUG: Committing changes ...")
fba.connection.commit()
- except BaseException as exc:
- print(f"ERROR: blocker='{blocker}',software='{software}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: blocker='{blocker}',software='{software}',exception[{type(exception)}]:'{str(exception)}'")
else:
print("WARNING: Unknown software:", blocker, software)
# DEBUG: print(f"DEBUG: blocked[]={type(blocked)}")
domains["reject"] = domains["reject"] + fba.find_domains(blocked)
- except BaseException as exc:
- print(f"ERROR: Cannot fetch from meta.chaos.social,exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: Cannot fetch from meta.chaos.social,exception[{type(exception)}]:'{str(exception)}'")
sys.exit(255)
# DEBUG: print(f"DEBUG: domains()={len(domains)}")
# DEBUG: print(f"DEBUG: Adding domain='{domain}'")
domains.append(domain)
- except BaseException as exc:
- print(f"ERROR: Cannot fetch args.feed='{args.feed}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: Cannot fetch args.feed='{args.feed}',exception[{type(exception)}]:'{str(exception)}'")
sys.exit(255)
# DEBUG: print(f"DEBUG: domains()={len(domains)}")
# DEBUG: print(f"DEBUG: Adding domain='{domain}',domains()={len(domains)}")
domains.append(domain)
- except BaseException as exc:
- print(f"ERROR: Cannot fetch feed='{feed}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: Cannot fetch feed='{feed}',exception[{type(exception)}]:'{str(exception)}'")
sys.exit(255)
# DEBUG: print(f"DEBUG: domains({len(domains)})={domains}")
reqheaders = {**headers, **{"X-CSRF-Token": csrf}}
- except BaseException as exc:
- # DEBUG: print(f"DEBUG: No CSRF token found, using normal headers: domain='{domain}',exc[{type(exc)}]={exc}")
+ except BaseException as exception:
+ # DEBUG: print(f"DEBUG: No CSRF token found, using normal headers: domain='{domain}',exception[{type(exception)}]={exception}")
pass
# DEBUG: print(f"DEBUG: reqheaders()={len(reqheaders)} - EXIT!")
if not instances.is_registered(instance):
# DEBUG: print("DEBUG: Adding new instance:", instance, domain)
instances.add(instance, domain, script)
- except BaseException as exc:
- print(f"ERROR: instance='{instance}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: instance='{instance}',exception[{type(exception)}]:'{str(exception)}'")
continue
# DEBUG: print("DEBUG: EXIT!")
# Cleanup old entries
# DEBUG: print(f"DEBUG: Purging old records (distance: {config.get('error_log_cleanup')})")
cursor.execute("DELETE FROM error_log WHERE created < ?", [time.time() - config.get("error_log_cleanup")])
- except BaseException as exc:
- print(f"ERROR: failed SQL query: domain='{domain}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: failed SQL query: domain='{domain}',exception[{type(exception)}]:'{str(exception)}'")
sys.exit(255)
# DEBUG: print("DEBUG: EXIT!")
# DEBUG: print("DEBUG: Querying API was successful:", domain, len(data))
peers = data
- except BaseException as exc:
- print("WARNING: Some error during fetch_peers():", domain, exc)
- instances.update_last_error(domain, exc)
+ except BaseException as exception:
+ print("WARNING: Some error during fetch_peers():", domain, exception)
+ instances.update_last_error(domain, exception)
# DEBUG: print(f"DEBUG: Adding '{len(peers)}' for domain='{domain}'")
instances.set_data("total_peers", domain, len(peers))
instances.update_last_error(domain, response)
continue
- except BaseException as exc:
+ except BaseException as exception:
# DEBUG: print("DEBUG: Cannot fetch API request:", request)
- instances.update_last_error(domain, exc)
+ instances.update_last_error(domain, exception)
pass
# DEBUG: print(f"DEBUG: data()={len(data)} - EXIT!")
else:
print("WARNING: nodeinfo does not contain 'links':", domain)
- except BaseException as exc:
+ except BaseException as exception:
print("WARNING: Failed fetching .well-known info:", domain)
- instances.update_last_error(domain, exc)
+ instances.update_last_error(domain, exception)
pass
# DEBUG: print("DEBUG: Returning data[]:", type(data))
instances.set_data("detection_mode", domain, "SITE_NAME")
remove_pending_error(domain)
- except BaseException as exc:
- # DEBUG: print(f"DEBUG: Cannot fetch / from '{domain}':", exc)
- instances.update_last_error(domain, exc)
+ except BaseException as exception:
+ # DEBUG: print(f"DEBUG: Cannot fetch / from '{domain}':", exception)
+ instances.update_last_error(domain, exception)
pass
# DEBUG: print(f"DEBUG: software[]={type(software)}")
print("WARNING: JSON response does not contain 'federated_instances':", domain)
instances.update_last_error(domain, response)
- except BaseException as exc:
- print(f"WARNING: Exception during fetching JSON: domain='{domain}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"WARNING: Exception during fetching JSON: domain='{domain}',exception[{type(exception)}]:'{str(exception)}'")
# DEBUG: print(f"DEBUG: Adding '{len(peers)}' for domain='{domain}'")
instances.set_data("total_peers", domain, len(peers))
network.fetch_response(domain, "/about/more", network.web_headers, (config.get("connection_timeout"), config.get("read_timeout"))).text,
"html.parser",
)
- except BaseException as exc:
- print("ERROR: Cannot fetch from domain:", domain, exc)
- instances.update_last_error(domain, exc)
+ except BaseException as exception:
+ print("ERROR: Cannot fetch from domain:", domain, exception)
+ instances.update_last_error(domain, exception)
return {}
for header in doc.find_all("h3"):
else:
print("WARNING: Unknown severity:", block['severity'], block['domain'])
- except BaseException as exc:
- # DEBUG: print(f"DEBUG: Failed, trying mastodon-specific fetches: domain='{domain}',exc[{type(exc)}]={str(exc)}")
+ except BaseException as exception:
+ # DEBUG: print(f"DEBUG: Failed, trying mastodon-specific fetches: domain='{domain}',exception[{type(exception)}]={str(exception)}")
rows = fetch_blocks_from_about(domain)
print(f"INFO: Checking {len(rows.items())} entries from domain='{domain}',software='mastodon' ...")
# DEBUG: print("DEBUG: Committing changes ...")
fba.connection.commit()
- except BaseException as exc:
- print(f"ERROR: domain='{domain}',software='mastodon',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: domain='{domain}',software='mastodon',exception[{type(exception)}]:'{str(exception)}'")
# DEBUG: print("DEBUG: EXIT!")
# DEBUG: print("DEBUG: API is no more returning new instances, aborting loop!")
break
- except BaseException as exc:
- print("WARNING: Caught error, exiting loop:", domain, exc)
- instances.update_last_error(domain, exc)
+ except BaseException as exception:
+ print("WARNING: Caught error, exiting loop:", domain, exception)
+ instances.update_last_error(domain, exception)
offset = 0
break
# DEBUG: print("DEBUG: API is no more returning new instances, aborting loop!")
break
- except BaseException as exc:
- print("ERROR: Exception during POST:", domain, exc)
- instances.update_last_error(domain, exc)
+ except BaseException as exception:
+ print("ERROR: Exception during POST:", domain, exception)
+ instances.update_last_error(domain, exception)
offset = 0
break
# Continue with next row
start = start + 100
- except BaseException as exc:
- print(f"WARNING: Exception during fetching JSON: domain='{domain}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"WARNING: Exception during fetching JSON: domain='{domain}',exception[{type(exception)}]:'{str(exception)}'")
# DEBUG: print(f"DEBUG: Adding '{len(peers)}' for domain='{domain}'")
instances.set_data("total_peers", domain, len(peers))
entry["reason"] = reason["reason"]
fba.connection.commit()
- except BaseException as exc:
- print(f"ERROR: domain='{domain}',software='pleroma',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: domain='{domain}',software='pleroma',exception[{type(exception)}]:'{str(exception)}'")
# DEBUG: print("DEBUG: EXIT!")
except:
pass
- except BaseException as exc:
- print(f"ERROR: failed SQL query: domain='{domain}',sql_string='{sql_string}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: failed SQL query: domain='{domain}',sql_string='{sql_string}',exception[{type(exception)}]:'{str(exception)}'")
sys.exit(255)
# DEBUG: print("DEBUG: EXIT!")
update_last_error(domain, fba.pending_errors[domain])
fba.remove_pending_error(domain)
- except BaseException as exc:
- print(f"ERROR: failed SQL query: domain='{domain}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: failed SQL query: domain='{domain}',exception[{type(exception)}]:'{str(exception)}'")
sys.exit(255)
else:
# DEBUG: print("DEBUG: Updating nodeinfo for domain:", domain)
# Check Set all
cache.set_all("is_registered", fba.cursor.fetchall(), True)
- except BaseException as exc:
- print(f"ERROR: failed SQL query: domain='{domain}',exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"ERROR: failed SQL query: domain='{domain}',exception[{type(exception)}]:'{str(exception)}'")
sys.exit(255)
# Is cache found?
print(f"WARNING: Cannot query JSON API: domain='{domain}',path='{path}',parameter()={len(parameter)},response.status_code='{response.status_code}',data[]='{type(data)}'")
instances.update_last_error(domain, response)
- except BaseException as exc:
- print(f"WARNING: Some error during post(): domain='{domain}',path='{path}',parameter()={len(parameter)},exc[{type(exc)}]:'{str(exc)}'")
+ except BaseException as exception:
+ print(f"WARNING: Some error during post(): domain='{domain}',path='{path}',parameter()={len(parameter)},exception[{type(exception)}]:'{str(exception)}'")
# DEBUG: print(f"DEBUG: Returning data({len(data)})=[]:{type(data)}")
return data
fetch_response(domain, "/friendica", web_headers, (config.get("connection_timeout"), config.get("read_timeout"))).text,
"html.parser",
)
- except BaseException as exc:
- print("WARNING: Failed to fetch /friendica from domain:", domain, exc)
- instances.update_last_error(domain, exc)
+ except BaseException as exception:
+ print("WARNING: Failed to fetch /friendica from domain:", domain, exception)
+ instances.update_last_error(domain, exception)
return {}
blocklist = doc.find(id="about_blocklist")
timeout=timeout
)
- except requests.exceptions.ConnectionError as exc:
- # DEBUG: print(f"DEBUG: Fetching '{path}' from '{domain}' failed. exc[{type(exc)}]='{str(exc)}'")
- instances.update_last_error(domain, exc)
- raise exc
+ except requests.exceptions.ConnectionError as exception:
+ # DEBUG: print(f"DEBUG: Fetching '{path}' from '{domain}' failed. exception[{type(exception)}]='{str(exception)}'")
+ instances.update_last_error(domain, exception)
+ raise exception
# DEBUG: print(f"DEBUG: response[]='{type(response)}' - EXXIT!")
return response