Skip to content

Commit

Permalink
Properly handle connection errors on server side
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Sep 5, 2019
1 parent e7c9ef0 commit 21b0621
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aiohttp/web_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ async def start(self) -> None:
self._handle_request(request, start))
try:
resp, reset = await task
except asyncio.CancelledError:
except (asyncio.CancelledError, ConnectionError):
self.log_debug('Ignored premature client disconnection')
break

Expand Down Expand Up @@ -568,7 +568,7 @@ async def finish_response(self,
try:
await prepare_meth(request)
await resp.write_eof()
except ConnectionResetError:
except ConnectionError:
await self.log_access(request, resp, start_time)
return True
else:
Expand Down

0 comments on commit 21b0621

Please sign in to comment.