# NOISY-DEBUG: print("DEBUG: AFTER res[]:", type(res))
if type(res) is str:
+ # NOISY-DEBUG: print(f"DEBUG: Setting last_error_details='{res}'");
cursor.execute("UPDATE instances SET last_status_code = 999, last_error_details = ?, last_updated = ? WHERE domain = ? LIMIT 1", [
res,
time.time(),
domain
])
else:
+ # NOISY-DEBUG: print(f"DEBUG: Setting last_error_details='{res.reason}'");
cursor.execute("UPDATE instances SET last_status_code = ?, last_error_details = ?, last_updated = ? WHERE domain = ? LIMIT 1", [
res.status_code,
res.reason,
print("ERROR: failed SQL query:", domain, e)
sys.exit(255)
- # NOISY-DEBUG: print(f"DEBUG: Deleting domain='{domain}' from pending_errors")
- del pending_errors[domain]
# NOISY-DEBUG: print("DEBUG: EXIT!")
def update_last_nodeinfo(domain: str):
if cursor.rowcount == 0:
print("WARNING: Did not update any rows:", domain)
- except baseException as e:
+ except BaseException as e:
print("ERROR: failed SQL query:", reason, blocker, blocked, block_level, e)
sys.exit(255)
reqto.get(f"https://{domain}/friendica", headers=headers, timeout=(config["connection_timeout"], config["read_timeout"])).text,
"html.parser",
)
- except baseException as e:
+ except BaseException as e:
print("WARNING: Failed to fetch /friendica from domain:", domain, e)
update_last_error(domain, e)
return {}