title: Websocket onerror - how to read error description?
body: <p>I've been developing browser-based multi player game for a while now and I've been testing different ports accessibility in various environment (client's office, public wifi etc.). All is going quite well, except one thing: I can't figure out is how to read error no. or description when onerror event is received.</p>
  
  <p>Client websocket is done in javascript.</p>
  
  <p>For example:</p>
  
  <pre><code>// Init of websocket
  websocket = new WebSocket(wsUri);
  websocket.onerror = OnSocketError;
  ...etc...
  
  // Handler for onerror:
  function OnSocketError(ev)
  {
      output("Socket error: " + ev.data);
  }
  </code></pre>
  
  <p>'output' is just some utility function that writes into a div.</p>
  
  <p>What I am getting is 'undefined' for ev.data. Always. And I've been googling around but it seems there's no specs on what params this event has and how to properly read it.</p>
  
  <p>Any help is appreciated!</p>