Catch ConnectionResetError exception when client disconnects

This commit is contained in:
grossmj 2023-08-12 17:31:58 +10:00
parent bbb0a407e0
commit 77d4eabadc

View File

@ -232,8 +232,7 @@ class Route(object):
response.set_status(408)
response.json({"message": "Request canceled", "status": 408})
raise # must raise to let aiohttp know the connection has been closed
except aiohttp.ClientError:
log.warning("Client error")
except (ConnectionResetError, aiohttp.ClientError):
response = Response(request=request, route=route)
response.set_status(408)
response.json({"message": "Client error", "status": 408})