Skip to content

Commit 80f347d

Browse files
committed
fix: log connection state when unable to attach
1 parent 82e16dc commit 80f347d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ably/realtime/realtime_channel.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,14 @@ async def attach(self) -> None:
183183
self.__error_reason = None
184184

185185
# RTL4b
186-
if self.__realtime.connection.state not in [
186+
connection_state = self.__realtime.connection.state
187+
if connection_state not in [
187188
ConnectionState.CONNECTING,
188189
ConnectionState.CONNECTED,
189190
ConnectionState.DISCONNECTED
190191
]:
191192
raise AblyException(
192-
message=f"Unable to attach; channel state = {self.state}",
193+
message=f"Unable to attach channel; connection state = {connection_state}",
193194
code=90001,
194195
status_code=400
195196
)

0 commit comments

Comments
 (0)