Class BunchedSerializationException

All Implemented Interfaces:
LoggableKeysAndValues<LoggableException>, Serializable

@API(EXPERIMENTAL) public class BunchedSerializationException extends BunchedMapException
Exception that can be thrown from a BunchedSerializer while serializing or deserializing an element. It attempts to include information along with the exception such as what inputs into the serializer caused the exception to be thrown.
See Also:
  • Constructor Details

    • BunchedSerializationException

      public BunchedSerializationException(@Nonnull String message)
      Create a new exception with a static message.
      Parameters:
      message - error message
    • BunchedSerializationException

      public BunchedSerializationException(@Nonnull String message, @Nonnull Throwable cause)
      Create a new exception with a static message and cause.
      Parameters:
      message - error message
      cause - cause
  • Method Details

    • setData

      @Nonnull public BunchedSerializationException setData(@Nonnull byte[] data)
      Set the data array that triggered this exception. This should be set if the error occurs while deserializing an array in order to preserve the array for diagnostic purposes.
      Parameters:
      data - raw data array that triggered this exception
      Returns:
      this BunchedSerializationException
    • getData

      @Nullable public byte[] getData()
      Return the raw bytes that triggered this exception. This will be null if the exception was not triggered while deserializing.
      Returns:
      the data array that triggered the exception
    • setValue

      @Nonnull public BunchedSerializationException setValue(@Nonnull Object value)
      Set the value that triggered this exception. This should be set if the error occurs while serializing an object to bytes. It should contain the item which triggered the error.
      Parameters:
      value - the value that triggered the exception
      Returns:
      this BunchedSerializationException
    • getValue

      @Nullable public Object getValue()
      Return the value that triggered this exception if set. This will be null if the exception was not triggered while serializing or if more than one value might have caused the error.
      Returns:
      the value that triggered the exception