From: Leif Åstrand Date: Thu, 22 Mar 2012 09:45:56 +0000 (+0200) Subject: Also show the exception type X-Git-Tag: 7.0.0.alpha2~251 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a9ccbdc36e909e0fcf79d7c3ce0f4062eacc710c;p=vaadin-framework.git Also show the exception type --- diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index 26a1329212..8be2d33838 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -564,7 +564,7 @@ public class ApplicationConfiguration implements EntryPoint { try { VNotification.createNotification( VNotification.DELAY_FOREVER).show( - getExceptionMessage(e), VNotification.CENTERED, + getExceptionText(e), VNotification.CENTERED, "error"); } catch (Exception e2) { // Just swallow this exception @@ -576,16 +576,21 @@ public class ApplicationConfiguration implements EntryPoint { deferredWidgetLoader = new DeferredWidgetLoader(); } - private static final String getExceptionMessage(Throwable e) { + private static final String getExceptionText(Throwable e) { if (e instanceof UmbrellaException) { UmbrellaException ue = (UmbrellaException) e; - String message = ""; + String text = ""; for (Throwable t : ue.getCauses()) { - message += getExceptionMessage(t) + "
"; + text += getExceptionText(t) + "
"; } - return message; + return text; } else { - return e.getMessage(); + String text = e.getClass().getName(); + String message = e.getMessage(); + if (message != null) { + text += ": " + message; + } + return text; } }