Package 

Class ExtCompositeException

  • All Implemented Interfaces:
    java.io.Serializable

    
    public final class ExtCompositeException
    extends RuntimeException
                        

    Represents an exception that is a composite of one or more other exceptions. A {@code ExtCompositeException} does not modify the structure of any exception it wraps, but at print-time it iterates through the list of Throwables contained in the composite in order to print them all. Its invariant is to contain an immutable, ordered (by insertion order), unique list of non-composite exceptions. You can retrieve individual exceptions in this list with getExceptions . The printStackTrace implementation handles the StackTrace in a customized way instead of using {@code getCause()} so that it can avoid circular references. If you invoke getCause , it will lazily create the causal chain but will stop if it finds any Throwable in the chain that it has already seen.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      abstract class PrintStreamOrWriter
      final class WrappedPrintStream

      Same abstraction and implementation as in JDK to allow PrintStream and PrintWriter to share implementation.

      final class WrappedPrintWriter
      final class CompositeExceptionCausalChain
    • Constructor Summary

      Constructors 
      Constructor Description
      ExtCompositeException(Array<Throwable> exceptions) Constructs a ExtCompositeException with the given array of Throwables as the list of suppressed exceptions.
      ExtCompositeException(Iterable<Out Throwable> errors) Constructs a ExtCompositeException with the given array of Throwables as the list of suppressed exceptions.
    • Method Summary

      Modifier and Type Method Description
      void printStackTrace() All of the following {@code printStackTrace} functionality is derived from JDK Throwable{@code printStackTrace} .
      void printStackTrace(PrintStream s)
      void printStackTrace(PrintWriter s)
      int size() Returns the number of suppressed exceptions.
      Throwable getRootCause(Throwable e) Returns the root cause of {@code e} .
      List<Throwable> getExceptions() Retrieves the list of exceptions that make up the {@code ExtCompositeException} .
      String getMessage()
      synchronized Throwable getCause()
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getOurStackTrace, getStackTrace, getStackTraceDepth, getStackTraceElement, getSuppressed, initCause, printEnclosedStackTrace, printStackTrace, readObject, setStackTrace, toString, validateSuppressedExceptionsList, writeObject
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExtCompositeException

        ExtCompositeException(Array<Throwable> exceptions)
        Constructs a ExtCompositeException with the given array of Throwables as the list of suppressed exceptions.
        Parameters:
        exceptions - the Throwables to have as initially suppressed exceptions
      • ExtCompositeException

        ExtCompositeException(Iterable<Out Throwable> errors)
        Constructs a ExtCompositeException with the given array of Throwables as the list of suppressed exceptions.
        Parameters:
        errors - the Throwables to have as initially suppressed exceptions