Skip to content

feat: deprecate constructor (Throwable, String) #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.flowingcode.vaadin.addons</groupId>
<artifactId>error-window-vaadin</artifactId>
<version>4.1.1-SNAPSHOT</version>
<version>4.2.0-SNAPSHOT</version>
<name>Error Window Add-on</name>
<description>Error handler that displays a dialog with exception information</description>
<url>https://www.flowingcode.com/en/open-source/</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
*/
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down Expand Up @@ -124,7 +112,6 @@ public ErrorwindowDemo() {
errorButton,
throwErrorWithoutErrorHandler,
throwErrorWithCustomMessageAndCustomTexts,
throwErrorWithCustomMessage,
throwErrori18nSupport);

add(new Button("Navigation error", ev -> {
Expand Down
Loading