protected void execute(JRaftServer server, final RpcContext asyncCtx, final Message message,
            final JRaftServer.RaftGroupTuple tuple) {
        FailoverClosure closure = new FailoverClosure() {
            
            Response data;
            
            Throwable ex;
            
            @Override
            public void setResponse(Response data) {
                this.data = data;
            }
            
            @Override
            public void setThrowable(Throwable throwable) {
                this.ex = throwable;
            }
            
            @Override
            public void run(Status status) {
                if (Objects.nonNull(ex)) {
                    Loggers.RAFT.error("execute has error : ", ex);
                    asyncCtx.sendResponse(Response.newBuilder().setErrMsg(ex.toString()).setSuccess(false).build());
                } else {
                    asyncCtx.sendResponse(data);
                }
            }
        };
        
        server.applyOperation(tuple.getNode(), message, closure);
    }
@Test
    void testErrorThroughRpc() {
        final AtomicReference<Response> reference = new AtomicReference<>();
        
        RpcContext context = new RpcContext() {
            @Override
            public void sendResponse(Object responseObj) {
                reference.set((Response) responseObj);
            }
            
            @Override
            public Connection getConnection() {
                return null;
            }
            
            @Override
            public String getRemoteAddress() {
                return null;
            }
        };
        AbstractProcessor processor = new NacosWriteRequestProcessor(server, SerializeFactory.getDefault());
        processor.execute(server, context, WriteRequest.newBuilder().build(), new JRaftServer.RaftGroupTuple());
        
        Response response = reference.get();
        assertNotNull(response);
        
        assertEquals("Error message transmission", response.getErrMsg());
        assertFalse(response.getSuccess());
    }