default Message newResponse(final Message parent, final int code, final String fmt, final Object... args) {
        final RpcRequests.ErrorResponse.Builder eBuilder = RpcRequests.ErrorResponse.newBuilder();
        eBuilder.setErrorCode(code);
        if (fmt != null) {
            eBuilder.setErrorMsg(String.format(fmt, args));
        }
        return eBuilder.build();
    }
Creates an error response with parameters.

@param parent parent message
@param code   error code with raft info
@param fmt    message with format string
@param args   arguments referenced by the format specifiers in the format string
@return a response instance
jraft-core/src/main/java/com/alipay/sofa/jraft/rpc/RpcResponseFactory.java