From 8085a4fbd7cd77d18ecfad93898aae1a7c94a21f Mon Sep 17 00:00:00 2001 From: owenpearson Date: Tue, 16 Dec 2025 16:26:05 +0000 Subject: [PATCH] fix: log connection state when unable to attach --- ably/realtime/channel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ably/realtime/channel.py b/ably/realtime/channel.py index 768eeb7d..4f95624e 100644 --- a/ably/realtime/channel.py +++ b/ably/realtime/channel.py @@ -128,13 +128,14 @@ async def attach(self) -> None: self.__error_reason = None # RTL4b - if self.__realtime.connection.state not in [ + connection_state = self.__realtime.connection.state + if connection_state not in [ ConnectionState.CONNECTING, ConnectionState.CONNECTED, ConnectionState.DISCONNECTED ]: raise AblyException( - message=f"Unable to attach; channel state = {self.state}", + message=f"Unable to attach channel; connection state = {connection_state}", code=90001, status_code=400 )