Class ErrorManager

java.lang.Object
com.flowingcode.vaadin.addons.errorwindow.ErrorManager

public final class ErrorManager extends Object
Manages errors and displays error messages through different ErrorWindowFactory implementations.
  • Method Details

    • showError

      public static void showError(Throwable throwable)
      Displays an error message for the given Throwable.
      Parameters:
      throwable - the Throwable object for which the error message should be displayed
    • showError

      public static void showError(Throwable throwable, String cause)
      Displays an error message for the given Throwable with the specified cause message.
      Parameters:
      throwable - the Throwable object for which the error message should be displayed
      cause - the cause for the error
    • setErrorWindowFactory

      public static void setErrorWindowFactory(Class<? extends Throwable> clazz, ErrorWindowFactory errorWindowFactory)
      Sets the ErrorWindowFactory for the specified Throwable class.
      Parameters:
      clazz - the class of Throwable for which the ErrorWindowFactory should be set
      errorWindowFactory - the ErrorWindowFactory implementation to be set for the specified class
    • getErrorWindowFactory

      public static ErrorWindowFactory getErrorWindowFactory(Class<?> clazz)
      Gets the ErrorWindowFactory implementation for the specified class or its super classes.
      Parameters:
      clazz - the class for which the ErrorWindowFactory implementation is needed
      Returns:
      the ErrorWindowFactory implementation associated with the specified class or its super classes
    • setErrorWindowFactory

      public static void setErrorWindowFactory(ErrorWindowFactory errorWindowFactory)
      Sets the default ErrorWindowFactory implementation.
      Parameters:
      errorWindowFactory - the default ErrorWindowFactory implementation to be set
    • getErrorWindowFactory

      public static ErrorWindowFactory getErrorWindowFactory()
      Gets the default ErrorWindowFactory implementation.
      Returns:
      the default ErrorWindowFactory implementation