Handle error event in websocket