Skip to content

Commit 8085a4f

Browse files
committed
fix: log connection state when unable to attach
1 parent 5cdfeb3 commit 8085a4f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

ably/realtime/channel.py

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

130130
# RTL4b
131-
if self.__realtime.connection.state not in [
131+
connection_state = self.__realtime.connection.state
132+
if connection_state not in [
132133
ConnectionState.CONNECTING,
133134
ConnectionState.CONNECTED,
134135
ConnectionState.DISCONNECTED
135136
]:
136137
raise AblyException(
137-
message=f"Unable to attach; channel state = {self.state}",
138+
message=f"Unable to attach channel; connection state = {connection_state}",
138139
code=90001,
139140
status_code=400
140141
)

0 commit comments

Comments
 (0)