diff options
author | Artur Signell <artur@vaadin.com> | 2014-12-22 13:30:55 +0200 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2015-01-05 12:16:20 +0200 |
commit | 69025a56d686fa14d991b8e2e950061fa9da7c25 (patch) | |
tree | de73d30105df9e9b438bef3e633f2ec92bc1769e | |
parent | 69f2dd2c45e0a403a3c7c0237cd74020f26f4672 (diff) | |
download | vaadin-framework-69025a56d686fa14d991b8e2e950061fa9da7c25.tar.gz vaadin-framework-69025a56d686fa14d991b8e2e950061fa9da7c25.zip |
Preserve newlines and align exception stacktraces left (#15456)
Change-Id: I1679f63554ff7a9f7f1e51e0988f03aede26c1ba
-rw-r--r-- | client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java | 11 |
1 files changed, 7 insertions, 4 deletions
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("<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 } |