Class SofabException

All Implemented Interfaces:
Serializable

public final class SofabException extends IOException
Thrown by the encoder and decoder on protocol or buffer errors.

It extends IOException so it composes naturally with Java I/O: a FlushSink that writes to a socket or file may itself throw IOException, and generated serialize code can simply declare throws IOException. The specific SofabError is available via error().

See Also:
  • Constructor Details

    • SofabException

      public SofabException(SofabError error)
      Create an exception for the given error category.
      Parameters:
      error - the error category
    • SofabException

      public SofabException(SofabError error, String detail)
      Create an exception for the given error category with extra detail.
      Parameters:
      error - the error category
      detail - human-readable context appended to the message
  • Method Details

    • error

      public SofabError error()
      The error category that caused this exception.
      Returns:
      the SofabError