Class CoordinationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.krabka.streams.coordination.CoordinationException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FencedException

public class CoordinationException extends RuntimeException
Reports a coordination failure.

This is the module's unchecked exception type. The record codec throws it for a malformed key or value and for a name that breaks its bounds. LeaseConfig throws it for a set of timings that cannot work together. The transport throws it for a broker call that fails. FencedException is the one subclass, and it reports the single failure a caller must treat as the end of a leadership.

The message text names the record part or the field that failed, so a failure identifies itself without a debugger.

Example

assertThatThrownBy(() -> Role.of(""))
    .isInstanceOf(CoordinationException.class)
    .hasMessage("a coordination role must not be empty");
See Also:
  • Constructor Details

    • CoordinationException

      public CoordinationException(String message)
      Creates an exception with a message.
      Parameters:
      message - a description of the failure
    • CoordinationException

      public CoordinationException(String message, Throwable cause)
      Creates an exception with a message and a cause.
      Parameters:
      message - a description of the failure
      cause - the underlying error