handle error in websocket example