def _handle_error(self, result, err_msg):
        if result.get(u'error'):
            raise RequestError("{}\nResponse: {}".format(
                err_msg,
                json.dumps(result, indent=2)
            ))
        else:
            return result.get(u'result')
Check result for error
dataset/ETHPy150Open hfaran/piazza-api/piazza_api/rpc.py/PiazzaRPC._handle_error