When the websocket connection is created and there's an exception thrown at this point we won't be able to catch it, leaving the client in an unrecoverable state (i.e. since the exception is not caught, the websocket artefacts are not properly cleared up).
socket.ready will complete with an error in case something goes wrong during WebSocketChannel.connect().
It's not an obvious API, but it seems to be the way to go with this package.
Similar to issues (issue 1 and issue 2) reported in web_socket_channel package.
When the websocket connection is created and there's an exception thrown at this point we won't be able to catch it, leaving the client in an unrecoverable state (i.e. since the exception is not caught, the websocket artefacts are not properly cleared up).
socket.ready
will complete with an error in case something goes wrong duringWebSocketChannel.connect()
.It's not an obvious API, but it seems to be the way to go with this package.