Package io.microraft.exception
Class RaftException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.microraft.exception.RaftException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CannotReplicateException
,IndeterminateStateException
,LaggingCommitIndexException
,MismatchingRaftGroupMembersCommitIndexException
,NotLeaderException
Base exception class for Raft-related exceptions.
- See Also:
-
Constructor Summary
ConstructorDescriptionRaftException
(RaftEndpoint leader) Creates an instance of this exceptionRaftException
(String message, RaftEndpoint leader) Creates an instance of this exceptionRaftException
(String message, RaftEndpoint leader, Throwable cause) Creates an instance of this exceptionRaftException
(Throwable cause) Creates an instance of this exception -
Method Summary
Modifier and TypeMethodDescriptionReturns the leader endpoint of the related Raft group, if available and known by the Raft node by the time this exception is thrown.toString()
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
RaftException
Creates an instance of this exception- Parameters:
cause
- reason of this exception to be thrown
-
RaftException
Creates an instance of this exception- Parameters:
leader
- Raft endpoint of the leader known by the local Raft node
-
RaftException
Creates an instance of this exception- Parameters:
message
- exception messageleader
- Raft endpoint of the leader known by the local Raft node
-
RaftException
Creates an instance of this exception- Parameters:
message
- exception messageleader
- Raft endpoint of the leader known by the local Raft nodecause
- reason of this exception to be thrown
-
-
Method Details
-
getLeader
Returns the leader endpoint of the related Raft group, if available and known by the Raft node by the time this exception is thrown.- Returns:
- the leader endpoint of the related Raft group, if available and known by the Raft node by the time this exception is thrown
-
toString
-