Interface FormatExceptionPolicy

  • All Superinterfaces:
    NoLambda, java.io.Serializable
    All Known Implementing Classes:
    FormatExceptionPolicyStrict

    public interface FormatExceptionPolicy
    extends java.io.Serializable, NoLambda
    A policy for handling exceptions in the format.
    • Method Detail

      • handleError

        void handleError​(java.lang.Throwable e,
                         FormatterStep step,
                         java.lang.String relativePath)
        Called for every error in the formatter.
      • toBytes

        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.
        Specified by:
        toBytes in interface NoLambda
      • failOnlyOnError

        static FormatExceptionPolicy failOnlyOnError()
        A policy which rethrows subclasses of Error and logs other kinds of Exception.