From 8f16cab0484a06f7be6e6df3abb979272db5e948 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Wed, 7 Dec 2022 23:15:31 -0500 Subject: [PATCH] prevent errors in post and fetch_nodeinfo --- relay/http_client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/relay/http_client.py b/relay/http_client.py index 28153a5..8802471 100644 --- a/relay/http_client.py +++ b/relay/http_client.py @@ -159,7 +159,7 @@ class HttpClient: return logging.verbose(await resp.read()) # change this to debug except (ClientConnectorError, ServerTimeoutError): - logging.verbose(f'Failed to connect to {url.netloc}') + logging.verbose(f'Failed to connect to {url}') ## prevent workers from being brought down except Exception as e: @@ -174,6 +174,10 @@ class HttpClient: loads = WellKnownNodeinfo.new_from_json ) + if not wk_nodeinfo: + logging.verbose(f'Failed to fetch well-known nodeinfo url for domain: {domain}') + return False + for version in ['20', '21']: try: nodeinfo_url = wk_nodeinfo.get_url(version)