diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java index 61e1057bf..af8d79597 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java @@ -10,6 +10,7 @@ package com.facebook.react.modules.websocket; import java.io.IOException; +import java.lang.IllegalStateException; import javax.annotation.Nullable; import com.facebook.common.logging.FLog; @@ -176,7 +177,7 @@ public class WebSocketModule extends ReactContextBaseJavaModule { client.sendMessage( WebSocket.PayloadType.TEXT, new Buffer().writeUtf8(message)); - } catch (IOException e) { + } catch (IOException | IllegalStateException e) { notifyWebSocketFailed(id, e.getMessage()); } }