Skip to content

Commit 8b7bfeb

Browse files
javier-godoymlopezFC
authored andcommitted
deprecate: deprecate constructor (Throwable, String)
Close #81
1 parent d74f290 commit 8b7bfeb

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/main/java/com/flowingcode/vaadin/addons/errorwindow/ErrorWindow.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ public ErrorWindow(final Throwable cause, final ErrorWindowI18n i18n) {
102102
*
103103
* @param cause The cause of the error
104104
* @param errorMessage An optional error message
105+
*
106+
* @deprecated The error message specified with this constructor is only displayed when production
107+
* mode is false. Use {@link #ErrorWindow(Throwable, ErrorWindowI18n)} for specifying
108+
* both debug and production mode messages.
105109
*/
110+
@Deprecated
106111
public ErrorWindow(final Throwable cause, final String errorMessage) {
107112
this(cause, errorMessage, isProductionMode(), ErrorWindowI18n.createDefault());
108113
}

src/test/java/com/flowingcode/vaadin/addons/errorwindow/ErrorwindowDemo.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,6 @@ public ErrorwindowDemo() {
6060
}
6161
});
6262

63-
Button throwErrorWithCustomMessage =
64-
new Button(
65-
"Throw Error with custom message",
66-
ev -> {
67-
try {
68-
Integer.parseInt("asdf");
69-
} catch (NumberFormatException e) {
70-
ErrorWindow w = new ErrorWindow(e, "CUSTOM ERROR MESSAGE");
71-
w.open();
72-
}
73-
});
74-
7563
Button throwErrorWithCustomMessageAndCustomTexts =
7664
new Button(
7765
"Throw Error with custom message (custom labels)",
@@ -124,7 +112,6 @@ public ErrorwindowDemo() {
124112
errorButton,
125113
throwErrorWithoutErrorHandler,
126114
throwErrorWithCustomMessageAndCustomTexts,
127-
throwErrorWithCustomMessage,
128115
throwErrori18nSupport);
129116

130117
add(new Button("Navigation error", ev -> {

0 commit comments

Comments
 (0)