Skip to content

Commit

Permalink
Catch ConnectionResetError exception when client disconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed Aug 12, 2023
1 parent bbb0a40 commit 77d4eab
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gns3server/web/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ async def control_schema(request):
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})
Expand Down

0 comments on commit 77d4eab

Please sign in to comment.