Package com.tuladb

Class LedgerClient.LedgerProtocolException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
com.tuladb.LedgerClient.LedgerProtocolException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LedgerClient.LedgerAuthException, LedgerClient.LedgerStatusException
Enclosing class:
LedgerClient

public static class LedgerClient.LedgerProtocolException extends IOException
A reply that is not a successful answer, as distinct from a transport failure. Two cases, told apart by statusCode():
  • An engine status (statusCode() != null): a RESP_ERROR frame carrying its status, or the declined item of a single write. Always thrown as the subclass LedgerClient.LedgerStatusException -- catch that type to handle engine statuses. Its status class is final (never retry), retryable (back off, retry with the same identity) or other.
  • A protocol error (statusCode() == null, thrown as this class itself): a frame that is not an engine answer -- an unexpected msg_type, or a RESP_ERROR too short to carry a status. The socket is reset and the request's outcome is unknown, as after a transport failure; it never reads as status 0.
Historically this one class carried both, which is why the engine-status exception had a protocol-sounding name. LedgerClient.LedgerStatusException extends it, so existing catch (LedgerProtocolException e) blocks keep catching engine statuses unchanged. Subclasses IOException for source compatibility with existing catch blocks.
See Also:
  • Constructor Details

    • LedgerProtocolException

      public LedgerProtocolException(String message)
    • LedgerProtocolException

      public LedgerProtocolException(String message, int msgType, Integer statusCode)
    • LedgerProtocolException

      public LedgerProtocolException(String message, int msgType, Integer statusCode, Object result)
      result: a declined single write's decoded item result, or null.
  • Method Details