Class DecodeException

java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.websocket.DecodeException
All Implemented Interfaces:
Serializable

public class DecodeException extends Exception
Exception thrown when a decoder fails to decode a WebSocket message.
See Also:
  • Constructor Details

    • DecodeException

      public DecodeException(ByteBuffer bb, String message, Throwable cause)
      Creates a DecodeException for binary data with the specified detail message and cause.
      Parameters:
      bb - The binary data that could not be decoded
      message - The detail message
      cause - The underlying cause of the exception
    • DecodeException

      public DecodeException(String encodedString, String message, Throwable cause)
      Creates a DecodeException for text data with the specified detail message and cause.
      Parameters:
      encodedString - The text data that could not be decoded
      message - The detail message
      cause - The underlying cause of the exception
    • DecodeException

      public DecodeException(ByteBuffer bb, String message)
      Creates a DecodeException for binary data with the specified detail message.
      Parameters:
      bb - The binary data that could not be decoded
      message - The detail message
    • DecodeException

      public DecodeException(String encodedString, String message)
      Creates a DecodeException for text data with the specified detail message.
      Parameters:
      encodedString - The text data that could not be decoded
      message - The detail message
  • Method Details

    • getBytes

      public ByteBuffer getBytes()
      Returns the binary data that could not be decoded.
      Returns:
      The binary data, or null if the exception was for text data
    • getText

      public String getText()
      Returns the text data that could not be decoded.
      Returns:
      The text data, or null if the exception was for binary data