mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-23 23:17:58 +00:00
Compare commits
1 commit
97e9f1a2fd
...
a1ac043d72
Author | SHA1 | Date | |
---|---|---|---|
a1ac043d72 |
|
@ -2,8 +2,7 @@ import logging
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from aiohttp import ClientSession, ClientTimeout, TCPConnector
|
from aiohttp import ClientSession, ClientTimeout, TCPConnector
|
||||||
from aiohttp.client_exceptions import ClientConnectionError, ClientSSLError
|
from aiohttp.client_exceptions import ClientConnectorError, ServerTimeoutError
|
||||||
from asyncio.exceptions import TimeoutError as AsyncTimeoutError
|
|
||||||
from aputils import Nodeinfo, WellKnownNodeinfo
|
from aputils import Nodeinfo, WellKnownNodeinfo
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from cachetools import LRUCache
|
from cachetools import LRUCache
|
||||||
|
@ -144,14 +143,12 @@ class HttpClient(AppBase):
|
||||||
except JSONDecodeError:
|
except JSONDecodeError:
|
||||||
logging.verbose(f'Failed to parse JSON')
|
logging.verbose(f'Failed to parse JSON')
|
||||||
|
|
||||||
except ClientSSLError:
|
except (ClientConnectorError, ServerTimeoutError):
|
||||||
logging.verbose(f'SSL error when connecting to {urlparse(url).netloc}')
|
|
||||||
|
|
||||||
except (AsyncTimeoutError, ClientConnectionError):
|
|
||||||
logging.verbose(f'Failed to connect to {urlparse(url).netloc}')
|
logging.verbose(f'Failed to connect to {urlparse(url).netloc}')
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
raise e
|
||||||
|
|
||||||
|
|
||||||
async def post(self, inbox, message):
|
async def post(self, inbox, message):
|
||||||
|
|
|
@ -3,4 +3,4 @@ aputils@https://git.barkshark.xyz/barkshark/aputils/archive/0.1.3.tar.gz
|
||||||
cachetools>=5.2.0
|
cachetools>=5.2.0
|
||||||
click>=8.1.2
|
click>=8.1.2
|
||||||
pyyaml>=6.0
|
pyyaml>=6.0
|
||||||
tinysql[all]@https://git.barkshark.xyz/barkshark/tinysql/archive/0.1.0.tar.gz
|
tinysql[postgres,mysql]@https://git.barkshark.xyz/barkshark/tinysql/archive/0.1.0.tar.gz
|
||||||
|
|
Loading…
Reference in a new issue