Added  onerror to websocket