diff --git a/pom.xml b/pom.xml
index b938d02..73a77d1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.flowingcode.vaadin.addons
error-window-vaadin
- 4.1.1-SNAPSHOT
+ 4.2.0-SNAPSHOT
Error Window Add-on
Error handler that displays a dialog with exception information
https://www.flowingcode.com/en/open-source/
diff --git a/src/main/java/com/flowingcode/vaadin/addons/errorwindow/ErrorWindow.java b/src/main/java/com/flowingcode/vaadin/addons/errorwindow/ErrorWindow.java
index fb01045..04886f9 100644
--- a/src/main/java/com/flowingcode/vaadin/addons/errorwindow/ErrorWindow.java
+++ b/src/main/java/com/flowingcode/vaadin/addons/errorwindow/ErrorWindow.java
@@ -98,20 +98,27 @@ public ErrorWindow(final Throwable cause, final ErrorWindowI18n i18n) {
}
/**
- * Constructs and initializes an ErrorWindow object with the supplied details and default and default production mode and i18n.
+ * Constructs and initializes an ErrorWindow object with the supplied details and default
+ * production mode and i18n.
*
* @param cause The cause of the error
- * @param errorMessage An optional error message
+ * @param errorMessage An optional error message that is displayed when production mode is false
+ *
+ * @deprecated The error message specified with this constructor is only displayed when production
+ * mode is false. Use {@link #ErrorWindow(Throwable, ErrorWindowI18n)} for specifying
+ * both debug and production mode messages.
*/
+ @Deprecated
public ErrorWindow(final Throwable cause, final String errorMessage) {
this(cause, errorMessage, isProductionMode(), ErrorWindowI18n.createDefault());
}
/**
- * Constructs and initializes an ErrorWindow object with the supplied details and default production mode.
+ * Constructs and initializes an ErrorWindow object with the supplied details and default
+ * production mode.
*
* @param cause The cause of the error
- * @param errorMessage An optional error message
+ * @param errorMessage An optional error message that is displayed when production mode is false
* @param i18n The internationalization of the ErrorWindow
*/
public ErrorWindow(final Throwable cause, final String errorMessage, final ErrorWindowI18n i18n) {
@@ -122,7 +129,7 @@ public ErrorWindow(final Throwable cause, final String errorMessage, final Error
* Constructs and initializes an ErrorWindow object with the supplied details and default i18n.
*
* @param cause The cause of the error
- * @param errorMessage An optional error message
+ * @param errorMessage An optional error message that is displayed when production mode is false
* @param productionMode The mode in which the Application is running. If true, a code is
* displayed with error details, else debug information is shown
*/
@@ -134,7 +141,7 @@ public ErrorWindow(final Throwable cause, final String errorMessage, boolean pro
* Constructs and initializes an ErrorWindow object with the supplied details.
*
* @param cause The cause of the error
- * @param errorMessage An optional error message
+ * @param errorMessage An optional error message that is displayed when production mode is false
* @param productionMode The mode in which the Application is running. If true, a code is
* displayed with error details, else debug information is shown
* @param i18n The internationalization of the ErrorWindow
diff --git a/src/test/java/com/flowingcode/vaadin/addons/errorwindow/ErrorwindowDemo.java b/src/test/java/com/flowingcode/vaadin/addons/errorwindow/ErrorwindowDemo.java
index cd83fff..5648db1 100644
--- a/src/test/java/com/flowingcode/vaadin/addons/errorwindow/ErrorwindowDemo.java
+++ b/src/test/java/com/flowingcode/vaadin/addons/errorwindow/ErrorwindowDemo.java
@@ -60,18 +60,6 @@ public ErrorwindowDemo() {
}
});
- 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();
- }
- });
-
Button throwErrorWithCustomMessageAndCustomTexts =
new Button(
"Throw Error with custom message (custom labels)",
@@ -124,7 +112,6 @@ public ErrorwindowDemo() {
errorButton,
throwErrorWithoutErrorHandler,
throwErrorWithCustomMessageAndCustomTexts,
- throwErrorWithCustomMessage,
throwErrori18nSupport);
add(new Button("Navigation error", ev -> {