]> source.dussan.org Git - vaadin-framework.git/commitdiff
SystemError now prints an xhtml message instead of "uidl" message (see #3712)
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 17 Nov 2009 07:08:34 +0000 (07:08 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 17 Nov 2009 07:08:34 +0000 (07:08 +0000)
svn changeset:9828/svn branch:6.2

src/com/vaadin/terminal/SystemError.java

index 6f29970f6ba888c010959dd50194f3fba90af974..8b721c07f5dc5e9e33e2acf530544c68dd71f139 100644 (file)
@@ -75,20 +75,27 @@ public class SystemError extends RuntimeException implements ErrorMessage {
         target.startTag("error");
         target.addAttribute("level", "system");
 
-        // Paint the error message
+        StringBuilder sb = new StringBuilder();
         final String message = getLocalizedMessage();
         if (message != null) {
-            target.addSection("h2", message);
+            sb.append("<h2>");
+            sb.append(message);
+            sb.append("</h2>");
         }
 
         // Paint the exception
         if (cause != null) {
-            target.addSection("h3", "Exception");
+            sb.append("<h3>Exception</h3>");
             final StringWriter buffer = new StringWriter();
             cause.printStackTrace(new PrintWriter(buffer));
-            target.addSection("pre", buffer.toString());
+            sb.append("<pre>");
+            sb.append(buffer.toString());
+            sb.append("</pre>");
         }
 
+        target.addXMLSection("div", sb.toString(),
+                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd");
+
         target.endTag("error");
 
     }