|
|
@@ -59,16 +59,10 @@ public class WebSocketListenerImpl extends WebSocketListener {
|
|
|
|
|
|
@Override
|
|
|
public void onFailure(WebSocket webSocket, Throwable throwable, Response response) {
|
|
|
- log.info("WebSocket 异常事件: {}", throwable.toString());
|
|
|
- if (throwable instanceof ConnectException
|
|
|
- || throwable instanceof EOFException
|
|
|
- || throwable instanceof ProtocolException) {
|
|
|
- wsClient.setConnected(false);
|
|
|
- if (wsClient.isRetry()) {
|
|
|
- reconnect();
|
|
|
- }
|
|
|
- } else {
|
|
|
- throwable.printStackTrace();
|
|
|
+ log.info("WebSocket 异常事件: {}", throwable.getMessage());
|
|
|
+ wsClient.setConnected(false);
|
|
|
+ if (wsClient.isRetry()) {
|
|
|
+ reconnect();
|
|
|
}
|
|
|
}
|
|
|
|