Better (maybe) error handling in websocket