Directory

← Back

Error Window Add-on

This add-on allows to add a sub-window to inform that an error was caused by an exception.

Author

Rating

Popularity

200+

The sub-window shows different information depending on the running mode of the application:

  • if the application is running in debug mode, it shows the stack trace of the exception.
  • if the application is running in production mode, it shows a code to report that can be found in log files.

The dialog (ErrorWindow) can be automatically invoked through an error handler configured by com.flowingcode.vaadin.addons.errorwindow.VaadinServiceInitListenerImpl or just by itself calling ErrorManager.showError(). It is also possible to use the ErrorWindow directly for messages customization purposes.

Sample code

        final Button errorButton = new Button("Throw Error", new ClickListener() {

            @Override
            public void buttonClick(final ClickEvent event) {
                Integer.parseInt("asdf");
            }
        });
        errorButton.setErrorHandler(new WindowErrorHandler(this));
		Button throwErrorWithoutErrorHandler = new Button("Throw Error without an error handler", ev->{
			try {
				Integer.parseInt("asdf");
			} catch (NumberFormatException e) {
				ErrorManager.showError(e);
			}
		});
		Button throwErrorWithCustomMessage = new Button("Throw Error with custom message", ev->{
			try {
				Integer.parseInt("asdf");
			} catch (NumberFormatException e) {
				ErrorWindow w = new ErrorWindow(e, "CUSTOM ERROR MESSAGE");
				w.open();
			}
		});

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Bug fixes:

  • Interpret exception message as plain text instead of HTML (#74)
Released
2023-09-18
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 14
Vaadin 22
Vaadin 23
Vaadin 24
Vaadin 7.7+ in 1.0.0
Vaadin 8.0+ in 2.0.0
Vaadin 14+ in 3.0.2
Browser
N/A

Error Window Add-on - Vaadin Add-on Directory

This add-on allows to add a sub-window to inform that an error was caused by an exception. Error Window Add-on - Vaadin Add-on Directory
The sub-window shows different information depending on the running mode of the application: * if the application is running in debug mode, it shows the stack trace of the exception. * if the application is running in production mode, it shows a code to report that can be found in log files. The dialog (ErrorWindow) can be automatically invoked through an error handler configured by `com.flowingcode.vaadin.addons.errorwindow.VaadinServiceInitListenerImpl` or just by itself calling `ErrorManager.showError()`. It is also possible to use the ErrorWindow directly for messages customization purposes.
Online