@Singleton public class JacksonExceptionSerializer extends Object implements ExceptionSerializer
DEFAULT, JACKSON| Constructor and Description |
|---|
JacksonExceptionSerializer(play.Environment environment) |
| Modifier and Type | Method and Description |
|---|---|
Throwable |
deserialize(RawExceptionMessage message)
Deserialize an exception message into an exception.
|
RawExceptionMessage |
serialize(Throwable exception,
Collection<MessageProtocol> accept)
Serialize the given exception to an exception message.
|
@Inject public JacksonExceptionSerializer(play.Environment environment)
public RawExceptionMessage serialize(Throwable exception, Collection<MessageProtocol> accept)
ExceptionSerializerThe raw exception message consists of an error code, a message protocol, and a message entity to send across the wire.
The exception serializer may attempt to match one of the protocols passed into the accept parameter.
serialize in interface ExceptionSerializerexception - The exception to serialize.accept - The accepted protocols.public Throwable deserialize(RawExceptionMessage message)
ExceptionSerializerThe exception serializer should make a best effort attempt at deserializing the message, but should not expect the message to be in any particular format. If it cannot deserialize the message, it should return a generic exception, it should not itself throw an exception.
deserialize in interface ExceptionSerializermessage - The message to deserialize.