diff --git a/trinity/protocol/common/managers.py b/trinity/protocol/common/managers.py index 26a3b43da6..5bbc9c9aec 100644 --- a/trinity/protocol/common/managers.py +++ b/trinity/protocol/common/managers.py @@ -176,13 +176,17 @@ async def _cleanup(self) -> None: if self.pending_request is not None: self.logger.debug("Stream %r shutting down, cancelling the pending request", self) _, future = self.pending_request - future.set_exception(PeerConnectionLost("Pending request can't complete: peer is gone")) + future.set_exception(PeerConnectionLost( + f"Pending request can't complete: {self} is shutting down" + )) def deregister_peer(self, peer: BasePeer) -> None: if self.pending_request is not None: self.logger.debug("Peer stream %r shutting down, cancelling the pending request", self) _, future = self.pending_request - future.set_exception(PeerConnectionLost("Pending request can't complete: peer is gone")) + future.set_exception(PeerConnectionLost( + f"Pending request can't complete: {self} peer went offline" + )) def __repr__(self) -> str: return f''