public void setError(int code, String fmt, Object... args) {
        this.state = new State(code, String.format(String.valueOf(fmt), args));
    }
Set error code and error msg.
jraft-core/src/main/java/com/alipay/sofa/jraft/Status.java