mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 06:27:59 +00:00
prevent errors in post and fetch_nodeinfo
This commit is contained in:
parent
7d37ec8145
commit
8f16cab048
|
@ -159,7 +159,7 @@ class HttpClient:
|
||||||
return logging.verbose(await resp.read()) # change this to debug
|
return logging.verbose(await resp.read()) # change this to debug
|
||||||
|
|
||||||
except (ClientConnectorError, ServerTimeoutError):
|
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
|
## prevent workers from being brought down
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -174,6 +174,10 @@ class HttpClient:
|
||||||
loads = WellKnownNodeinfo.new_from_json
|
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']:
|
for version in ['20', '21']:
|
||||||
try:
|
try:
|
||||||
nodeinfo_url = wk_nodeinfo.get_url(version)
|
nodeinfo_url = wk_nodeinfo.get_url(version)
|
||||||
|
|
Loading…
Reference in a new issue