Class ErrorWindow

All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasComponents, HasElement, HasEnabled, HasSize, HasTheme, Serializable

@CssImport("./flowingcode/error-window.css") public class ErrorWindow extends Dialog
Component to visualize an error, caused by an exception, as a modal sub-window. When in production mode it shows a code to report. When in debug mode it allows to visualize the stack trace of the error.

This class has several constructors that allow specifying the cause of the error, an error message, whether the application is in production mode, and the internationalization of the error message.

This class also provides constructors that accept an ErrorDetails instance, which provides additional information about the error.

A unique identifier is assigned to the dialog window, for use in reporting the error when in production mode.

Author:
pbartolo
See Also:
  • Constructor Details

    • ErrorWindow

      public ErrorWindow(Throwable cause)
      Constructs and initializes an ErrorWindow object with the supplied cause and default production mode and i18n.
      Parameters:
      cause - The cause of the error
    • ErrorWindow

      public ErrorWindow(Throwable cause, ErrorWindowI18n i18n)
      Constructs and initializes an ErrorWindow object with the supplied details and and default production mode.
      Parameters:
      cause - The cause of the error
      i18n - The internationalization of the ErrorWindow
    • ErrorWindow

      @Deprecated public ErrorWindow(Throwable cause, String errorMessage)
      Deprecated.
      The error message specified with this constructor is only displayed when production mode is false. Use ErrorWindow(Throwable, ErrorWindowI18n) for specifying both debug and production mode messages.
      Constructs and initializes an ErrorWindow object with the supplied details and default production mode and i18n.
      Parameters:
      cause - The cause of the error
      errorMessage - An optional error message that is displayed when production mode is false
    • ErrorWindow

      public ErrorWindow(Throwable cause, String errorMessage, ErrorWindowI18n i18n)
      Constructs and initializes an ErrorWindow object with the supplied details and default production mode.
      Parameters:
      cause - The cause of the error
      errorMessage - An optional error message that is displayed when production mode is false
      i18n - The internationalization of the ErrorWindow
    • ErrorWindow

      public ErrorWindow(Throwable cause, String errorMessage, boolean productionMode)
      Constructs and initializes an ErrorWindow object with the supplied details and default i18n.
      Parameters:
      cause - The cause of the error
      errorMessage - An optional error message that is displayed when production mode is false
      productionMode - The mode in which the Application is running. If true, a code is displayed with error details, else debug information is shown
    • ErrorWindow

      public ErrorWindow(Throwable cause, String errorMessage, boolean productionMode, ErrorWindowI18n i18n)
      Constructs and initializes an ErrorWindow object with the supplied details.
      Parameters:
      cause - The cause of the error
      errorMessage - An optional error message that is displayed when production mode is false
      productionMode - The mode in which the Application is running. If true, a code is displayed with error details, else debug information is shown
      i18n - The internationalization of the ErrorWindow
    • ErrorWindow

      public ErrorWindow(ErrorDetails errorDetails)
    • ErrorWindow

      public ErrorWindow(ErrorDetails errorDetails, boolean productionMode)
    • ErrorWindow

      public ErrorWindow(ErrorDetails errorDetails, ErrorWindowI18n i18n)
      Constructs and initializes an ErrorWindow object with the supplied error details and internationalization. This constructor allows for provision of additional information, which is an ErrorDetails object.
      Parameters:
      errorDetails - The ErrorDetails object
      i18n - The internationalization of the ErrorWindow
  • Method Details