Skip to content

Commit 36a0cfc

Browse files
GuilhermeJGuilhermeJ
authored andcommitted
Better treatment of InterruptionException in blocking method
1 parent 4b392f3 commit 36a0cfc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/src/main/java/ua/naiksoftware/stomp/WebSocketsConnectionProvider.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ class WebSocketsConnectionProvider extends AbstractConnectionProvider {
4848

4949
@Override
5050
public void rawDisconnect() {
51-
while(!mWebSocketClient.isClosed()) {
52-
try {
53-
mWebSocketClient.closeBlocking();
54-
break;
55-
} catch (InterruptedException ignored) { }
51+
try {
52+
mWebSocketClient.closeBlocking();
53+
} catch (InterruptedException e) {
54+
Log.e(TAG, "Thread interrupted while waiting for Websocket closing: ", e);
55+
throw new RuntimeException(e);
5656
}
5757
}
5858

0 commit comments

Comments
 (0)