diff --git a/libtextsecure/src/main/java/org/whispersystems/textsecure/internal/websocket/WebSocketConnection.java b/libtextsecure/src/main/java/org/whispersystems/textsecure/internal/websocket/WebSocketConnection.java index 87ceb8c300..425a8a9dc7 100644 --- a/libtextsecure/src/main/java/org/whispersystems/textsecure/internal/websocket/WebSocketConnection.java +++ b/libtextsecure/src/main/java/org/whispersystems/textsecure/internal/websocket/WebSocketConnection.java @@ -188,7 +188,13 @@ public class WebSocketConnection { while (newSocket()) { try { - Response response = webSocket.connect(Client.this); + Response response; + + try { + response = webSocket.connect(Client.this); + } catch (IllegalStateException e) { + throw new IOException(e); + } if (response.code() == 101) { onConnected();