diff --git a/polygon/websocket/__init__.py b/polygon/websocket/__init__.py index 5b9b283f..b8ed4775 100644 --- a/polygon/websocket/__init__.py +++ b/polygon/websocket/__init__.py @@ -132,11 +132,11 @@ async def connect( if len(cmsg) > 0: await processor(cmsg) # type: ignore - except ConnectionClosedOK: - logger.debug("connection closed (OK)") + except ConnectionClosedOK as e: + logger.debug("connection closed (OK): %s", e) return - except ConnectionClosedError: - logger.debug("connection closed (ERR)") + except ConnectionClosedError as e: + logger.debug("connection closed (ERR): %s", e) reconnects += 1 self.scheduled_subs = set(self.subs) self.subs = set()