Class ErrorWindow
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.dialog.GeneratedVaadinDialog<Dialog>
com.vaadin.flow.component.dialog.Dialog
com.flowingcode.vaadin.addons.errorwindow.ErrorWindow
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasComponents,HasElement,HasEnabled,HasSize,HasTheme,Serializable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.dialog.Dialog
Dialog.DialogCloseActionEvent, Dialog.DialogResizeEventNested classes/interfaces inherited from class com.vaadin.flow.component.dialog.GeneratedVaadinDialog
GeneratedVaadinDialog.OpenedChangeEvent<R extends GeneratedVaadinDialog<R>> -
Constructor Summary
ConstructorsConstructorDescriptionErrorWindow(ErrorDetails errorDetails) ErrorWindow(ErrorDetails errorDetails, boolean productionMode) ErrorWindow(ErrorDetails errorDetails, ErrorWindowI18n i18n) Constructs and initializes an ErrorWindow object with the supplied error details and internationalization.ErrorWindow(Throwable cause) Constructs and initializes an ErrorWindow object with the supplied cause and default production mode and i18n.ErrorWindow(Throwable cause, ErrorWindowI18n i18n) Constructs and initializes an ErrorWindow object with the supplied details and and default production mode.ErrorWindow(Throwable cause, String errorMessage) Deprecated.The error message specified with this constructor is only displayed when production mode is false.ErrorWindow(Throwable cause, String errorMessage, boolean productionMode) Constructs and initializes an ErrorWindow object with the supplied details and default i18n.ErrorWindow(Throwable cause, String errorMessage, boolean productionMode, ErrorWindowI18n i18n) Constructs and initializes an ErrorWindow object with the supplied details.ErrorWindow(Throwable cause, String errorMessage, ErrorWindowI18n i18n) Constructs and initializes an ErrorWindow object with the supplied details and default production mode. -
Method Summary
Methods inherited from class com.vaadin.flow.component.dialog.Dialog
add, addAttachListener, addComponentAtIndex, addDetachListener, addDialogCloseActionListener, addOpenedChangeListener, addResizeListener, addThemeVariants, close, getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, isCloseOnEsc, isCloseOnOutsideClick, isDraggable, isModal, isOpened, isResizable, onAttach, open, remove, removeAll, removeThemeVariants, setCloseOnEsc, setCloseOnOutsideClick, setDraggable, setHeight, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setModal, setOpened, setResizable, setWidthMethods inherited from class com.vaadin.flow.component.dialog.GeneratedVaadinDialog
getAriaLabelString, isOpenedBoolean, setAriaLabelMethods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.HasComponents
add, addComponentAsFirstMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
getHeightUnit, getWidthUnit, setHeight, setHeightFull, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
-
Constructor Details
-
ErrorWindow
Constructs and initializes an ErrorWindow object with the supplied cause and default production mode and i18n.- Parameters:
cause- The cause of the error
-
ErrorWindow
Constructs and initializes an ErrorWindow object with the supplied details and and default production mode.- Parameters:
cause- The cause of the errori18n- The internationalization of the ErrorWindow
-
ErrorWindow
Deprecated.The error message specified with this constructor is only displayed when production mode is false. UseErrorWindow(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 errorerrorMessage- An optional error message that is displayed when production mode is false
-
ErrorWindow
Constructs and initializes an ErrorWindow object with the supplied details and default production mode.- Parameters:
cause- The cause of the errorerrorMessage- An optional error message that is displayed when production mode is falsei18n- The internationalization of the ErrorWindow
-
ErrorWindow
Constructs and initializes an ErrorWindow object with the supplied details and default i18n.- Parameters:
cause- The cause of the errorerrorMessage- An optional error message that is displayed when production mode is falseproductionMode- 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 errorerrorMessage- An optional error message that is displayed when production mode is falseproductionMode- The mode in which the Application is running. If true, a code is displayed with error details, else debug information is showni18n- The internationalization of the ErrorWindow
-
ErrorWindow
-
ErrorWindow
-
ErrorWindow
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 objecti18n- The internationalization of the ErrorWindow
-
-
Method Details
-
getChildren
- Overrides:
getChildrenin classDialog
-
createStackTraceArea
-
createErrorLabel
-