Class EventStreamError
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- software.amazon.awssdk.eventstreamrpc.model.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 Summary
Constructors Constructor Description EventStreamError(String message)
Creates a new EventStream error with only a messageEventStreamError(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
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EventStreamError
create(List<software.amazon.awssdk.crt.eventstream.Header> headers, byte[] payload, software.amazon.awssdk.crt.eventstream.MessageType messageType)
Creates a new EventStreamErrorList<software.amazon.awssdk.crt.eventstream.Header>
getMessageHeaders()
Returns the headers associated with the EventStreamErrorsoftware.amazon.awssdk.crt.eventstream.MessageType
getMessageType()
Returns the message type associated with the EventStreamError-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
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 EventStreamErrorheaders
- Headers to associate with the EventStreamErrormessageType
- 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 outputpayload
- The payload to associated with the EventStreamErrormessageType
- 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
-
-