def run(self):
        res = None
        os.system('clear')

        while True:
            try:
                # get the server version
                if not self.server_version:
                    self.server_version = self.client.perform_request('version')

                    # if the server supports async mode, use it, as some views may only work in async mode
                    if self.server_version.capabilities and 'async' in self.server_version.capabilities:
                        self.block = False
                    elif self.supports_blocking:
                        self.block = True
                    else:
                        raise BlockingNotSupportedError("Debugger requires blocking mode")

                # render the view. if this view is running in asynchronous mode, the view should return immediately.
                self.render()

                # if the view is not blocking (server supports async || view doesn't support sync), block until the
                # debugger stops again
                if not self.block:
                    done = False
                    while not done:
                        res = self.client.perform_request('version', block=True)
                        if res.is_success:
                            done = True
            except ConnectionError as e:
                # what the hell, requests? a message is a message, not a fucking nested error object
                try:
                    msg = e.message.args[1].strerror
                except:
                    try:
                        msg = e.message.args[0]
                    except:
                        msg = str(e)
                traceback.print_exc()
                # if we're not connected, render an error and try again in a second
                self.do_render(error='Error: {}'.format(msg))
                self.server_version = None
                time.sleep(1)
dataset/ETHPy150Open snare/voltron/voltron/view.py/VoltronView.run/original