aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-03-21 14:12:52 +0200
committerLeif Åstrand <leif@vaadin.com>2012-03-21 14:12:52 +0200
commit4144a02d5dbf972043a898379c24326286fbfad6 (patch)
treea40751a07df36e23f6300b02f9ddeea73102fdf4 /src
parent1324d7b519186fced47cc637cc7298a8fbe7a88e (diff)
downloadvaadin-framework-4144a02d5dbf972043a898379c24326286fbfad6.tar.gz
vaadin-framework-4144a02d5dbf972043a898379c24326286fbfad6.zip
Improve notification for uncaught UmbrellaException
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
index fac6cfc40c..26a1329212 100644
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
@@ -15,6 +15,7 @@ import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+import com.google.gwt.event.shared.UmbrellaException;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Timer;
import com.vaadin.terminal.gwt.client.ui.UnknownComponentConnector;
@@ -562,8 +563,9 @@ public class ApplicationConfiguration implements EntryPoint {
try {
VNotification.createNotification(
- VNotification.DELAY_FOREVER).show(e.getMessage(),
- VNotification.CENTERED, "error");
+ VNotification.DELAY_FOREVER).show(
+ getExceptionMessage(e), VNotification.CENTERED,
+ "error");
} catch (Exception e2) {
// Just swallow this exception
}
@@ -574,6 +576,19 @@ public class ApplicationConfiguration implements EntryPoint {
deferredWidgetLoader = new DeferredWidgetLoader();
}
+ private static final String getExceptionMessage(Throwable e) {
+ if (e instanceof UmbrellaException) {
+ UmbrellaException ue = (UmbrellaException) e;
+ String message = "";
+ for (Throwable t : ue.getCauses()) {
+ message += getExceptionMessage(t) + "<br />";
+ }
+ return message;
+ } else {
+ return e.getMessage();
+ }
+ }
+
/**
* Registers that callback that the bootstrap javascript uses to start
* applications once the widgetset is loaded and all required information is