title: How to tell when a Stomp server disconnected from the Stomp.JS client
body: <p>I am sending a stomp message over a Sock.JS client. When I disconnect the server I would like a warning message to show up on the client. To do this I have implemented a server side heartbeat</p>
  <pre class="lang-js prettyprint-override"><code>stompClient = Stomp.over(socket);
  stompClient.heartbeat.outgoing = 20000;
  stompClient.heartbeat.incoming = 20000;
  stompClient.connect({}, function(frame) {
    ...
  }
  </code></pre>
  <p>In the Chrome developer console I see the message</p>
  <pre><code>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 
  </code></pre>
  <p>How can I capture this error message?</p>