]> source.dussan.org Git - vaadin-framework.git/commitdiff
Preserve newlines and align exception stacktraces left (#15456)
authorArtur Signell <artur@vaadin.com>
Mon, 22 Dec 2014 11:30:55 +0000 (13:30 +0200)
committerArtur Signell <artur@vaadin.com>
Tue, 23 Dec 2014 09:24:05 +0000 (09:24 +0000)
Change-Id: I1679f63554ff7a9f7f1e51e0988f03aede26c1ba

client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java

index f4fbe12c0d2a09293ec3e54638adb5261400df11..5d128cbdcc96ec28cdcd4dd9c5d615e45b06054f 100644 (file)
@@ -20,6 +20,7 @@ import java.util.logging.Handler;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
 
+import com.google.gwt.dom.client.Style.TextAlign;
 import com.google.gwt.logging.client.TextLogFormatter;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.client.ApplicationConfiguration;
@@ -65,10 +66,12 @@ public class ErrorNotificationHandler extends Handler {
                         .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");
+            VNotification n = VNotification.createNotification(
+                    VNotification.DELAY_FOREVER, owner);
+            n.getElement().getStyle().setTextAlign(TextAlign.LEFT);
+            n.show("<h1>Uncaught client side exception</h1><br />"
+                    + exceptionText.replace("\n", "<br/>\n"),
+                    VNotification.CENTERED, "error");
         } catch (Exception e2) {
             // Just swallow this exception
         }