summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-11-26 23:59:29 +0200
committerArtur Signell <artur@vaadin.com>2012-11-26 23:59:50 +0200
commitddeda372222eb7ccae0ecc47881f89f3383a0767 (patch)
treec0c73ee009de83d5455a568eb4b8030c4647ba11 /client
parent57ad5b2fbe98af98b48f3f82ef19a2656cf5328e (diff)
downloadvaadin-framework-ddeda372222eb7ccae0ecc47881f89f3383a0767.tar.gz
vaadin-framework-ddeda372222eb7ccae0ecc47881f89f3383a0767.zip
Ensure critical notifications have an owner (#10386)
Change-Id: Id954f1fbc98625dac4c79637ffb2f03bde195c3d
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/VDebugConsole.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/VDebugConsole.java b/client/src/com/vaadin/client/VDebugConsole.java
index 67980cc5a3..a6eb769059 100644
--- a/client/src/com/vaadin/client/VDebugConsole.java
+++ b/client/src/com/vaadin/client/VDebugConsole.java
@@ -694,7 +694,18 @@ public class VDebugConsole extends VOverlay implements Console {
e.printStackTrace();
}
try {
- VNotification.createNotification(VNotification.DELAY_FOREVER, null)
+ Widget owner = null;
+
+ if (!ApplicationConfiguration.getRunningApplications().isEmpty()) {
+ // Make a wild guess and use the first available
+ // ApplicationConnection. This is better than than leaving the
+ // exception completely unstyled...
+ ApplicationConnection connection = ApplicationConfiguration
+ .getRunningApplications().get(0);
+ owner = connection.getUIConnector().getWidget();
+ }
+ VNotification
+ .createNotification(VNotification.DELAY_FOREVER, owner)
.show("<h1>Uncaught client side exception</h1><br />"
+ exceptionText, VNotification.CENTERED, "error");
} catch (Exception e2) {