def protorpc_to_endpoints_error(self, status, body):
    try:
      rpc_error = protojson.decode_message(remote.RpcStatus, body)
    except (ValueError, messages.ValidationError):
      rpc_error = remote.RpcStatus()

    if rpc_error.state == remote.RpcStatus.State.APPLICATION_ERROR:


      error_class = _ERROR_NAME_MAP.get(rpc_error.error_name)
      if error_class:
        status, body = self.__write_error(error_class.http_status,
                                          rpc_error.error_message)
    return status, body
Create function for asynchronous auto suggestion.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/endpoints/apiserving.py/_ApiServer.protorpc_to_endpoints_error--crossover with--dataset/ETHPy150Open jonathanslenders/python-prompt-toolkit/prompt_toolkit/interface.py/CommandLineInterface._create_auto_suggest_function