我正在使用Sock.JS客户端发送一个stomp消息。当我断开与服务器的连接时,我希望在客户端上显示一个警告消息。为此,我已经实现了服务器端的心跳。
stompClient = Stomp.over(socket);
stompClient.heartbeat.outgoing = 20000;
stompClient.heartbeat.incoming = 20000;
stompClient.connect({}, function(frame) {
...
}
在Chrome开发者控制台中,我看到以下信息:
POST http://localhost:8080/hello/800/8n_btbxb/xhr_streaming net::ERR_CONNECTION_RESET sockjs-0.3.min.js:27
Whoops! Lost connection to undefined
我该如何捕获这个错误信息?