async def METHOD_NAME(self, proc):
    count = 0
    while True:
        try:
            await self.connect()
            return await proc()
        except (
            OSError,
            ConnectionError,
            json.JSONDecodeError,
            UnicodeDecodeError,
        ) as e:
            self.logger.warning("Error talking to server: %s" % e)
            if count >= 3:
                if not isinstance(e, ConnectionError):
                    raise ConnectionError(str(e))
                raise e
            await self.close()
            count += 1