public class RawExceptionMessage extends Object
A serialized exception message consists of a transport error code, a protocol, and a message body. All, some or none of these details may be sent over the wire when the error is sent, depending on what the underlying protocol supports.
Some protocols have a maximum limit on the amount of data that can be sent with an error message, eg for WebSockets, the WebSocket close frame can have a maximum payload of 125 bytes. While it's up to the transport implementation itself to enforce this limit and gracefully handle when the message exceeds this, exception serializers should be aware of this when producing exception messages.
Constructor and Description |
---|
RawExceptionMessage(TransportErrorCode errorCode,
MessageProtocol protocol,
akka.util.ByteString message) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
TransportErrorCode |
errorCode()
The error code.
|
int |
hashCode() |
akka.util.ByteString |
message()
The message.
|
String |
messageAsText()
Get the message as text.
|
MessageProtocol |
protocol()
The protocol.
|
String |
toString() |
public RawExceptionMessage(TransportErrorCode errorCode, MessageProtocol protocol, akka.util.ByteString message)
public TransportErrorCode errorCode()
This will be sent as an HTTP status code, or WebSocket close code.
public MessageProtocol protocol()
public akka.util.ByteString message()
public String messageAsText()
If this is a binary message (that is, the message protocol does not define a charset), encodes it using Base64.