@Override
    public String toString() {
        if (isOk()) {
            return "Status[OK]";
        } else {
            return "Status[" + RaftError.describeCode(this.state.code) + "<" + this.state.code + ">: " + this.state.msg
                   + "]";
        }
    }
Set raft error and error msg.
jraft-core/src/main/java/com/alipay/sofa/jraft/Status.java