Skip to content

Commit

Permalink
Set cause for ClientPayloadError (#8049)
Browse files Browse the repository at this point in the history
(cherry picked from commit a379e63)
  • Loading branch information
Dreamsorcerer authored and patchback[bot] committed Jan 21, 2024
1 parent 1a389a5 commit 34352e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aiohttp/client_proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ def connection_lost(self, exc: Optional[BaseException]) -> None:
if self._parser is not None:
try:
uncompleted = self._parser.feed_eof()
except Exception:
except Exception as e:
if self._payload is not None:
self._payload.set_exception(
ClientPayloadError("Response payload is not completed")
)
exc = ClientPayloadError("Response payload is not completed")
exc.__cause__ = e
self._payload.set_exception(exc)

if not self.is_eof():
if isinstance(exc, OSError):
Expand Down

0 comments on commit 34352e5

Please sign in to comment.