Class RaftException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CannotReplicateException, IndeterminateStateException, LaggingCommitIndexException, MismatchingRaftGroupMembersCommitIndexException, NotLeaderException

public class RaftException extends RuntimeException
Base exception class for Raft-related exceptions.
See Also:
  • Constructor Details

    • RaftException

      public RaftException(Throwable cause)
      Creates an instance of this exception
      Parameters:
      cause - reason of this exception to be thrown
    • RaftException

      public RaftException(RaftEndpoint leader)
      Creates an instance of this exception
      Parameters:
      leader - Raft endpoint of the leader known by the local Raft node
    • RaftException

      public RaftException(String message, RaftEndpoint leader)
      Creates an instance of this exception
      Parameters:
      message - exception message
      leader - Raft endpoint of the leader known by the local Raft node
    • RaftException

      public RaftException(String message, RaftEndpoint leader, Throwable cause)
      Creates an instance of this exception
      Parameters:
      message - exception message
      leader - Raft endpoint of the leader known by the local Raft node
      cause - reason of this exception to be thrown
  • Method Details

    • getLeader

      public RaftEndpoint 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

      public String toString()
      Overrides:
      toString in class Throwable