From 0b979aa06c41dec08fc0dbdface210fa4fe30f65 Mon Sep 17 00:00:00 2001
From: Javier Godoy <11554739+javier-godoy@users.noreply.github.com>
Date: Thu, 26 Dec 2024 14:28:10 -0300
Subject: [PATCH 1/3] build: set version to 4.2.0-SNAPSHOT
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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/
From e294cdc233e20c40b1b40654a80ddb14b5393e32 Mon Sep 17 00:00:00 2001
From: Javier Godoy <11554739+javier-godoy@users.noreply.github.com>
Date: Thu, 26 Dec 2024 14:25:42 -0300
Subject: [PATCH 2/3] deprecate: deprecate constructor (Throwable, String)
Close #81
---
.../vaadin/addons/errorwindow/ErrorWindow.java | 5 +++++
.../vaadin/addons/errorwindow/ErrorwindowDemo.java | 13 -------------
2 files changed, 5 insertions(+), 13 deletions(-)
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..dbcafd7 100644
--- a/src/main/java/com/flowingcode/vaadin/addons/errorwindow/ErrorWindow.java
+++ b/src/main/java/com/flowingcode/vaadin/addons/errorwindow/ErrorWindow.java
@@ -102,7 +102,12 @@ public ErrorWindow(final Throwable cause, final ErrorWindowI18n i18n) {
*
* @param cause The cause of the error
* @param errorMessage An optional error message
+ *
+ * @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());
}
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 -> {
From 3a779576fc4c80a43044e44e3ad6c8d7644b9f40 Mon Sep 17 00:00:00 2001
From: Javier Godoy <11554739+javier-godoy@users.noreply.github.com>
Date: Thu, 26 Dec 2024 14:26:53 -0300
Subject: [PATCH 3/3] docs: clarify "errorMessage" constructor parameter
---
.../vaadin/addons/errorwindow/ErrorWindow.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
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 dbcafd7..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,10 +98,11 @@ 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
@@ -113,10 +114,11 @@ public ErrorWindow(final Throwable cause, final String errorMessage) {
}
/**
- * 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) {
@@ -127,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
*/
@@ -139,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