]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added communication error details to error popup. #4502
authorJohn Alhroos <john.ahlroos@itmill.com>
Tue, 22 Jun 2010 10:34:53 +0000 (10:34 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Tue, 22 Jun 2010 10:34:53 +0000 (10:34 +0000)
svn changeset:13854/svn branch:6.4

src/com/vaadin/terminal/gwt/client/ApplicationConnection.java

index 43e861c98e467e0d6d3d9235aed34f37a288d177..5f71183c2569bc5c5aef70c963304c7b048a2d7b 100755 (executable)
@@ -500,30 +500,37 @@ public class ApplicationConnection {
     }
 
     /**
-     * Shows the communication error notification. The 'details' only go to the
-     * console for now.
+     * Shows the communication error notification.
      * 
      * @param details
      *            Optional details for debugging.
      */
     private void showCommunicationError(String details) {
         console.error("Communication error: " + details);
-        String html = "";
+        StringBuilder html = new StringBuilder();
         if (configuration.getCommunicationErrorCaption() != null) {
-            html += "<h1>" + configuration.getCommunicationErrorCaption()
-                    + "</h1>";
+            html.append("<h1>");
+            html.append(configuration.getCommunicationErrorCaption());
+            html.append("</h1>");
         }
         if (configuration.getCommunicationErrorMessage() != null) {
-            html += "<p>" + configuration.getCommunicationErrorMessage()
-                    + "</p>";
+            html.append("<p>");
+            html.append(configuration.getCommunicationErrorMessage());
+            html.append("</p>");
         }
+
         if (html.length() > 0) {
+
+            // Add error description
+            html.append("<br/><p><I style=\"font-size:0.7em\">");
+            html.append(details);
+            html.append("</I></p>");
+
             VNotification n = new VNotification(1000 * 60 * 45);
             n.addEventListener(new NotificationRedirect(configuration
                     .getCommunicationErrorUrl()));
-            n
-                    .show(html, VNotification.CENTERED_TOP,
-                            VNotification.STYLE_SYSTEM);
+            n.show(html.toString(), VNotification.CENTERED_TOP,
+                    VNotification.STYLE_SYSTEM);
         } else {
             redirect(configuration.getCommunicationErrorUrl());
         }