summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-12-22 13:30:55 +0200
committerArtur Signell <artur@vaadin.com>2014-12-23 09:24:05 +0000
commit42a4c72741fb4a45d491839b207a8662ff93fdb4 (patch)
tree817871985cf49cabdfc67ee6c334f0258d64e6f8
parent0aa061929ffdc893034d8bf88fd83dc6baa28bfc (diff)
downloadvaadin-framework-42a4c72741fb4a45d491839b207a8662ff93fdb4.tar.gz
vaadin-framework-42a4c72741fb4a45d491839b207a8662ff93fdb4.zip
Preserve newlines and align exception stacktraces left (#15456)
Change-Id: I1679f63554ff7a9f7f1e51e0988f03aede26c1ba
-rw-r--r--client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java11
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
}