From 69025a56d686fa14d991b8e2e950061fa9da7c25 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 22 Dec 2014 13:30:55 +0200 Subject: Preserve newlines and align exception stacktraces left (#15456) Change-Id: I1679f63554ff7a9f7f1e51e0988f03aede26c1ba --- .../client/debug/internal/ErrorNotificationHandler.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'client') diff --git a/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java b/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java index f4fbe12c0d..5d128cbdcc 100644 --- a/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java +++ b/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java @@ -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("

Uncaught client side exception


" - + exceptionText, VNotification.CENTERED, "error"); + VNotification n = VNotification.createNotification( + VNotification.DELAY_FOREVER, owner); + n.getElement().getStyle().setTextAlign(TextAlign.LEFT); + n.show("

Uncaught client side exception


" + + exceptionText.replace("\n", "
\n"), + VNotification.CENTERED, "error"); } catch (Exception e2) { // Just swallow this exception } -- cgit v1.2.3