Skip to content

Commit

Permalink
Set cause for ClientPayloadError (#8049)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Jan 21, 2024
1 parent f530e92 commit a379e63
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 @@ -93,11 +93,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 a379e63

Please sign in to comment.