Class MultiException

java.lang.Object
java.lang.Throwable
java.lang.Exception
io.deephaven.util.MultiException
All Implemented Interfaces:
Serializable

public class MultiException extends Exception
An exception to use when a series of operations must all be executed, but may all throw exceptions themselves. This allows for retention of all exception data.
See Also:
  • Field Details

    • ZERO_LENGTH_THROWABLE_ARRAY

      public static final Throwable[] ZERO_LENGTH_THROWABLE_ARRAY
  • Constructor Details

    • MultiException

      public MultiException(String description, Throwable... causes)
      Create a MultiException from an array of Throwable causes.
      Parameters:
      description - the message to use
      causes - a list of causes
  • Method Details

    • maybeWrapInMultiException

      public static Throwable maybeWrapInMultiException(String description, Throwable... causes)
      If there is a single exception, return that exception; otherwise wrap the causes into a MultiException.
      Parameters:
      description - the description for the MultiException
      causes - the array of causes
      Returns:
      a MultiException or the single Throwable
    • maybeWrapInMultiException

      public static Throwable maybeWrapInMultiException(String description, List<? extends Throwable> causes)
      If there is a single exception, return that exception; otherwise wrap the causes into a MultiException.
      Parameters:
      description - the description for the MultiException
      causes - the list of causes
      Returns:
      a MultiException or the single Throwable
    • maybeWrapInMultiException

      public static Exception maybeWrapInMultiException(String description, Exception... causes)
      If there is a single exception, return that exception; otherwise wrap the causes into a MultiException.
      Parameters:
      description - the description for the MultiException
      causes - the array of causes
      Returns:
      a MultiException or the single Exception
    • getCauses

      public Throwable[] getCauses()
      Returns:
      all of the exceptions that resulted in this one.
    • printStackTrace

      public void printStackTrace(PrintWriter s)
      Overrides:
      printStackTrace in class Throwable
    • printStackTrace

      public void printStackTrace(PrintStream s)
      Overrides:
      printStackTrace in class Throwable
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • toString

      public String toString()
      Overrides:
      toString in class Throwable