handle error case from websocket library