Error Window Add-on
This add-on allows to add a sub-window to inform that an error was caused by an exception.
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.
Found a bug or have a suggestion? Report it on GitHub
For bug reports, feature suggestions, or questions, please open an issue on GitHub. This makes it easier for us to track and respond efficiently, ensuring you get the best possible support. Your input helps us improve—thank you!
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(); } });
Links
Compatibility
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
New features:
- Released
- 2025-02-13
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 14
- Vaadin 22
- Vaadin 23
- Vaadin 24
- Vaadin 14+ in 3.3.0
- Vaadin 8.0+ in 2.0.1
- Vaadin 7.7+ in 1.0.0
- 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.Online Demo
Source Code
Issue Tracker
Author Homepage
Error Window Add-on version 1.0.0
First version of the Addon, compatible with Vaadin 7
Error Window Add-on version 2.0.0
First version of the Addon, compatible with Vaadin 8
Error Window Add-on version 3.0.2
Initial release supporting Vaadin 14+ Npm mode
Error Window Add-on version 2.0.1
Allow detailed information in Production Mode
Error Window Add-on version 3.0.3
* Remove flow-build-info.json from compiled JAR
* Replace vaadin dependency with vaadin-core
Error Window Add-on version 3.1.0
### New features
* [#16](https://github.com/FlowingCode/ErrorWindowAddon/issues/16): make ErrorWindow internationalizable
### Bugfixes
* [#18](https://github.com/FlowingCode/ErrorWindowAddon/issues/18): check if production mode is enabled from ErrorWindow constructors
Error Window Add-on version 3.1.1
### Bugfixes:
* [#21](https://github.com/FlowingCode/ErrorWindowAddon/issues/21): Avoid showing error dialog when UI is not available
Error Window Add-on version 3.2.0
### New features
* Allow registering ErrorWindowFactory per exception type ([#27](https://github.com/FlowingCode/ErrorWindowAddon/issues/27))
* Add error view
* Allow an arbitrary Component in createStackTraceArea ([#28](https://github.com/FlowingCode/ErrorWindowAddon/issues/27))
* Move inline styles to CSS
* Use h1/div instead of h3/h4 ([#29](https://github.com/FlowingCode/ErrorWindowAddon/issues/27))
* Make ErrorWindow resizable when the stacktrace is visible ([#24](https://github.com/FlowingCode/ErrorWindowAddon/issues/27))
* Make ErrorWindow draggable
### Bugfixes
* Make ErrorWindow stacktrace responsive
### Other changes:
* Replace TextArea with Div in ErrorWindow
Error Window Add-on version 3.3.0
#### New Features
* Add option to copy stack trace to clipboard ([#37](https://github.com/FlowingCode/ErrorWindowAddon/issues/37))
Error Window Add-on version 3.4.0
#### New features:
* feat: handle UploadException ([#42](https://github.com/FlowingCode/ErrorWindowAddon/issues/42))
* refactor: initialize ErrorWindow on attach ([#44](https://github.com/FlowingCode/ErrorWindowAddon/issues/44))
* refactor: remove clipboardhelper dependency ([#50](https://github.com/FlowingCode/ErrorWindowAddon/issues/50))
Error Window Add-on version 3.5.0
#### Bug fixes:
- fix compatibility with Vaadin 24.0.0.alpha6 ([#53](https://github.com/FlowingCode/ErrorWindowAddon/issues/53))
#### New features:
- add i18n support ([#43](https://github.com/FlowingCode/ErrorWindowAddon/issues/43))
Error Window Add-on version 3.5.1
#### Bug fixes:
* add jakarta.annotation.security.PermitAll annotation ([#60](https://github.com/FlowingCode/ErrorWindowAddon/issues/60))
* set javax.annotation-api dependency optional ([#61](https://github.com/FlowingCode/ErrorWindowAddon/issues/61))
Error Window Add-on version 3.6.0
#### New features:
* Improve styles ([#35](https://github.com/FlowingCode/ErrorWindowAddon/issues/35))
Error Window Add-on version 3.7.0
#### New features:
* Add error event observer
Error Window Add-on version 4.0.0
#### Bug fixes:
* Interpret exception message as plain text instead of HTML ([#74](https://github.com/FlowingCode/ErrorWindowAddon/issues/74))
Error Window Add-on version 4.0.1
#### Bug fixes:
* Avoid dependency with httpcore
* Make ErrorWindowI18n serializable ([#77](https://github.com/FlowingCode/ErrorWindowAddon/issues/77))
Error Window Add-on version 4.1.0
#### New features:
* Default to actual production mode from Vaadin ([#79](https://github.com/FlowingCode/ErrorWindowAddon/issues/79))
Error Window Add-on version 4.2.0
#### New features:
* Deprecate constructor (Throwable, String) ([#81](https://github.com/FlowingCode/ErrorWindowAddon/issues/81))
* Add jandex index ([#85](https://github.com/FlowingCode/ErrorWindowAddon/issues/85))