Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/src/main/java/io/ably/lib/transport/WebSocketTransport.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import javax.net.ssl.SSLSocketFactory;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.exceptions.WebsocketNotConnectedException;
import org.java_websocket.framing.CloseFrame;
import org.java_websocket.framing.Framedata;
import org.java_websocket.handshake.ServerHandshake;
Expand Down Expand Up @@ -112,7 +113,14 @@ public void send(ProtocolMessage msg) throws AblyException {
Log.v(TAG, "send(): " + new String(ProtocolSerializer.writeJSON(msg)));
wsConnection.send(ProtocolSerializer.writeJSON(msg));
}
} catch (Exception e) {
}
catch (WebsocketNotConnectedException e){
if(connectListener != null) {
connectListener.onTransportUnavailable(this, AblyException.fromThrowable(e).errorInfo);
} else
throw AblyException.fromThrowable(e);
}
catch (Exception e) {
throw AblyException.fromThrowable(e);
}
}
Expand Down