diff --git a/pytec/pytec/aioclient.py b/pytec/pytec/aioclient.py index d939329..30264f1 100644 --- a/pytec/pytec/aioclient.py +++ b/pytec/pytec/aioclient.py @@ -38,8 +38,8 @@ class Client: self.timeout = timeout try: self._reader, self._writer = await self._connecting_task - except asyncio.CancelledError: - raise StoppedConnecting + except asyncio.CancelledError as exc: + raise StoppedConnecting from exc finally: self._connecting_task = None