Добавлена обработка ошибки sockjs

This commit is contained in:
serega6531
2019-05-12 03:51:11 +03:00
parent 1e08c70a3b
commit 48397aed09
2 changed files with 10 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.sockjs.SockJsTransportFailureException;
import ru.serega6531.packmate.model.Stream;
import java.io.IOException;
@@ -40,7 +41,7 @@ public class StreamSubscriptionService {
subscribers.forEach(s -> {
try {
s.sendMessage(objectToTextMessage(stream));
} catch (IOException e) {
} catch (IOException | SockJsTransportFailureException e) {
e.printStackTrace();
}
});