add extra logging in misc.request

This commit is contained in:
Izalia Mae 2022-11-22 18:11:41 -05:00
parent a838e4324b
commit da56d4bb61

View file

@ -10,6 +10,7 @@ from Crypto.Hash import SHA, SHA256, SHA512
from Crypto.PublicKey import RSA from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5 from Crypto.Signature import PKCS1_v1_5
from aiohttp import ClientSession from aiohttp import ClientSession
from aiohttp.client_exceptions import ClientConnectorError
from aiohttp.hdrs import METH_ALL as METHODS from aiohttp.hdrs import METH_ALL as METHODS
from aiohttp.web import Response as AiohttpResponse, View as AiohttpView from aiohttp.web import Response as AiohttpResponse, View as AiohttpView
from datetime import datetime from datetime import datetime
@ -260,6 +261,11 @@ async def request(uri, data=None, force=False, sign_headers=True, activity=True)
return resp_data return resp_data
except JSONDecodeError: except JSONDecodeError:
logging.verbose(f'Failed to parse JSON')
return
except ClientConnectorError:
logging.verbose(f'Failed to connect to {url.netloc}')
return return
except Exception: except Exception: