Enum ExceptionVisualizer

java.lang.Object
java.lang.Enum<ExceptionVisualizer>
com.illumon.iris.console.utils.ExceptionVisualizer
All Implemented Interfaces:
com.fishlib.util.process.FatalErrorReporter.Interceptor, Serializable, Comparable<ExceptionVisualizer>, java.lang.constant.Constable, Thread.UncaughtExceptionHandler

public enum ExceptionVisualizer
extends Enum<ExceptionVisualizer>
implements Thread.UncaughtExceptionHandler, com.fishlib.util.process.FatalErrorReporter.Interceptor
This class provides a means to queue up exceptions and display them to a user. If the GUI is visible when new exceptions are added, they are added to the existing GUI's list. This also provides for suppression of exception causes, and sending support requests.
  • Enum Constant Details

  • Method Details

    • values

      public static ExceptionVisualizer[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ExceptionVisualizer valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • isSuppressed

      public <T extends Throwable> boolean isSuppressed​(Class<T> type, boolean forceAllow)
      Check if a specific exception type is currently suppressed.
      Type Parameters:
      T - Something that extends Throwable
      Parameters:
      type - The exception to check for suppression
      forceAllow - forces type suppression to be allowed
      Returns:
      true if the exception is currently suppressed.
    • visualize

      public void visualize​(Throwable t, boolean fatal, boolean blocking)

      Visualize the supplied exception.

      This will use the current time and thread as display details

      Parameters:
      t - The exception to visualize
      blocking - If true, this method will not return until the user closes the dialog
    • visualize

      public void visualize​(Throwable t, boolean fatal, boolean blocking, ZonedDateTime time, Thread thread)

      Visualize the supplied exception.

      This will use the current time and thread as display details

      Parameters:
      t - The exception to visualize
      blocking - If true, this method will not return until the user closes the dialog
      time - The time the exception occured
      thread - The thread the exeception occured on
    • visualize

      public void visualize​(Throwable t, boolean fatal, boolean blocking, ZonedDateTime time, Thread thread, Component source)

      Visualize the supplied exception.

      This will use the current time and thread as display details

      Parameters:
      t - The exception to visualize
      blocking - If true, this method will not return until the user closes the dialog
      time - The time the exception occured
      thread - The thread the exeception occured on
      source - The source component to center the GUI on.
    • newVisualizer

      public ExceptionVisualizer.Visualizer newVisualizer​(boolean modal, Collection<Throwable> exceptions)
      Create a new Visualizer that can be used to local error reporting. This method does not need to be invoked on the swing thread.
      Parameters:
      modal - If the dialog should be modal
      exceptions - The set of exceptions to visualize.
      Returns:
      The visualizer. Users should invoke Dialog.setVisible(boolean) to show the dialog.
    • newVisualizer

      public ExceptionVisualizer.Visualizer newVisualizer​(boolean modal, Throwable... exceptions)
      Create a new Visualizer that can be used to local error reporting. This method does not need to be invoked on the swing thread.
      Parameters:
      modal - If the dialog should be modal
      exceptions - The set of exceptions to visualize.
      Returns:
      The visualizer. Users should invoke Dialog.setVisible(boolean) to show the dialog.
    • uncaughtException

      public void uncaughtException​(Thread t, Throwable e)
      Specified by:
      uncaughtException in interface Thread.UncaughtExceptionHandler
    • intercept

      public void intercept​(@NotNull String message, @NotNull Throwable throwable)
      Specified by:
      intercept in interface com.fishlib.util.process.FatalErrorReporter.Interceptor
    • asErrorReporter

      public ErrorReporter asErrorReporter()