Skip to content

Commit a379e63

Browse files
Set cause for ClientPayloadError (#8049)
1 parent f530e92 commit a379e63

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

aiohttp/client_proto.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ def connection_lost(self, exc: Optional[BaseException]) -> None:
9393
if self._parser is not None:
9494
try:
9595
uncompleted = self._parser.feed_eof()
96-
except Exception:
96+
except Exception as e:
9797
if self._payload is not None:
98-
self._payload.set_exception(
99-
ClientPayloadError("Response payload is not completed")
100-
)
98+
exc = ClientPayloadError("Response payload is not completed")
99+
exc.__cause__ = e
100+
self._payload.set_exception(exc)
101101

102102
if not self.is_eof():
103103
if isinstance(exc, OSError):

0 commit comments

Comments
 (0)