'Check for success of the RPC, possibly raising an exception.
This function should be called at least once per RPC.  If wait()
hasn\'t been called yet, it is called first.  If the RPC caused
an exceptional condition, an exception will be raised here.
The first time check_success() is called, the postcall hooks
are called.'

def check_success(self):

    self.wait()
    try:
        self.__rpc.CheckSuccess()
    except Exception as err:
        if (not self.__postcall_hooks_called):
            self.__postcall_hooks_called = True
            self.__stubmap.GetPostCallHooks().Call(self.__service, self.__method, self.request, self.response, self.__rpc, err)
        raise
    else:
        if (not self.__postcall_hooks_called):
            self.__postcall_hooks_called = True
            self.__stubmap.GetPostCallHooks().Call(self.__service, self.__method, self.request, self.response, self.__rpc)
