use of org.apache.ignite.raft.jraft.error.RaftException in project ignite-3 by apache.
the class LogManagerImpl method reportError.
private void reportError(final int code, final String fmt, final Object... args) {
this.hasError = true;
final RaftException error = new RaftException(ErrorType.ERROR_TYPE_LOG);
error.setStatus(new Status(code, fmt, args));
this.fsmCaller.onError(error);
}
use of org.apache.ignite.raft.jraft.error.RaftException in project ignite-3 by apache.
the class FSMCallerTest method testOnError.
@Test
public void testOnError() throws Exception {
this.fsmCaller.onError(new RaftException(ErrorType.ERROR_TYPE_LOG, new Status(-1, "test")));
this.fsmCaller.flush();
assertFalse(this.fsmCaller.getError().getStatus().isOk());
assertEquals(ErrorType.ERROR_TYPE_LOG, this.fsmCaller.getError().getType());
Mockito.verify(this.node).onError(Mockito.any());
Mockito.verify(this.fsm).onError(Mockito.any());
}
Aggregations