How to use the rpcq._base.from_json function in rpcq

To help you get started, we’ve selected a few rpcq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rigetti / pyquil / pyquil / api / _compiler.py View on Github external
except RequestException as e:
            message = f"QPU Compiler {method} failed: "

            try:
                contents = response.json()
            except Exception:
                contents = None

            if contents and contents.get("message"):
                message += contents.get("message")
            else:
                message += "please try again or contact support."

            raise UserMessageError(message) from e

        return from_json(response.text)