def _get_result_or_raise_error(reply):
        """
        Raise any error message returned from a Jade rpc call as an exception.

        Parameters
        ----------
        reply : dict
            Dictionary representing a reply from a Jade rpc call.

        Returns
        -------
        dict
            Any nested 'result' structure, if the reply is not an error.

        Raises
        ------
        JadeError
            If the reply represented an error, including all details received.
        """
        if 'error' in reply:
            e = reply['error']
            raise JadeError(e.get('code'), e.get('message'), e.get('data'))

        return reply['result']

        Raise any error message returned from a Jade rpc call as an exception.

        Parameters
        ----------
        reply : dict
            Dictionary representing a reply from a Jade rpc call.

        Returns
        -------
        dict
            Any nested 'result' structure, if the reply is not an error.

        Raises
        ------
        JadeError
            If the reply represented an error, including all details received.
        
electrum/plugins/jade/jadepy/jade.py