Class EventStreamError

  • All Implemented Interfaces:
    Serializable

    public class EventStreamError
    extends RuntimeException
    Used to hold event stream RPC error messages that are not tied to any service. Message info comes back with a payload of JSON like: { "message": "..." } And we map that to this exception type to convey the information
    See Also:
    Serialized Form
    • Constructor Detail

      • EventStreamError

        public EventStreamError​(String message)
        Creates a new EventStream error with only a message
        Parameters:
        message - The message to associate with the EventStreamError
      • EventStreamError

        public EventStreamError​(String message,
                                List<software.amazon.awssdk.crt.eventstream.Header> headers,
                                software.amazon.awssdk.crt.eventstream.MessageType messageType)
        Creates a new EventStreamError with a message, headers, and message type
        Parameters:
        message - The message to associate with the EventStreamError
        headers - Headers to associate with the EventStreamError
        messageType - The message type to associate with the EventStreamError
    • Method Detail

      • create

        public static EventStreamError create​(List<software.amazon.awssdk.crt.eventstream.Header> headers,
                                              byte[] payload,
                                              software.amazon.awssdk.crt.eventstream.MessageType messageType)
        Creates a new EventStreamError
        Parameters:
        headers - currently unusued, but likely a useful element for output
        payload - The payload to associated with the EventStreamError
        messageType - The message type to associate with the EventStreamError
        Returns:
        A new EventStreamError
      • getMessageHeaders

        public List<software.amazon.awssdk.crt.eventstream.Header> getMessageHeaders()
        Returns the headers associated with the EventStreamError
        Returns:
        the headers associated with the EventStreamError
      • getMessageType

        public software.amazon.awssdk.crt.eventstream.MessageType getMessageType()
        Returns the message type associated with the EventStreamError
        Returns:
        the message type associated with the EventStreamError