public interface FormatExceptionPolicy extends Serializable, NoLambda
A policy for handling exceptions in the format.
NoLambda.EqualityBasedOnSerialization| Modifier and Type | Method and Description |
|---|---|
static FormatExceptionPolicy |
failOnlyOnError()
A policy which rethrows subclasses of
Error and logs other kinds of Exception. |
void |
handleError(Throwable e,
FormatterStep step,
String relativePath)
Called for every error in the formatter.
|
byte[] |
toBytes()
Returns a byte array representation of everything inside this
FormatExceptionPolicy. |
void handleError(Throwable e, FormatterStep step, String relativePath)
Called for every error in the formatter.
byte[] toBytes()
Returns a byte array representation of everything inside this FormatExceptionPolicy.
The main purpose of this method is to ensure one can’t instantiate this class with lambda expressions, which are notoriously difficult to serialize and deserialize properly.
static FormatExceptionPolicy failOnlyOnError()
A policy which rethrows subclasses of Error and logs other kinds of Exception.