Skip to content

Commit 6d6ea2b

Browse files
committed
- Corrected artifact id
- Updated demo for showing other use cases
1 parent 3883254 commit 6d6ea2b

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.flowingcode.vaadin.addons</groupId>
5-
<artifactId>error-window-addon</artifactId>
5+
6+
<artifactId>error-window-vaadin</artifactId>
67
<version>3.0.1-SNAPSHOT</version>
78
<name>Error Window Add-on Project</name>
89

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,32 @@ public DemoUI() {
3131
Button errorButton = new Button("Throw Error", event -> {
3232
Integer.parseInt("asdf");
3333
});
34+
35+
Button throwErrorWithoutErrorHandler = new Button("Throw Error without an error handler", ev->{
36+
try {
37+
Integer.parseInt("asdf");
38+
} catch (NumberFormatException e) {
39+
ErrorManager.showError(e);
40+
}
41+
});
42+
43+
Button throwErrorWithCustomMessage = new Button("Throw Error with custom message", ev->{
44+
try {
45+
Integer.parseInt("asdf");
46+
} catch (NumberFormatException e) {
47+
ErrorWindow w = new ErrorWindow(e, "CUSTOM ERROR MESSAGE");
48+
w.open();
49+
}
50+
});
51+
3452
Button toggleProductionMode = new Button("Toggle production mode");
3553
toggleProductionMode.addClickListener(ev->{
3654
System.setProperty("productionMode",""+("false".equals(System.getProperty("productionMode"))));
3755
Notification.show("Currently production mode is: " + System.getProperty("productionMode"));
3856
});
39-
add(errorButton, toggleProductionMode);
40-
4157

58+
add(errorButton, throwErrorWithoutErrorHandler, throwErrorWithCustomMessage, toggleProductionMode);
59+
4260
}
4361

4462
}

0 commit comments

Comments
 (0)