--- gtester-report	2009-08-19 21:25:07.000000000 +0400
+++ gtester-report.patched	2009-08-20 00:31:56.000000000 +0400
@@ -219,10 +219,18 @@
     self.oprint ('<td>%s %s</td> <td align="right">%s</td> \n' % (html_indent_string (4), path, duration))
     perflist = list_children (node, 'performance')
     if result != 'success':
-      rlist = list_children (node, 'error')
+      rlist = []
+      for child in node.childNodes:
+          if child.nodeName == 'error' or child.nodeName == 'message':
+            rlist += [ child ]
       txt = ''
       for enode in rlist:
-        txt += node_as_text (enode)
+        node_txt = node_as_text (enode)
+        # strip leading and trailing whitespace characters from the message
+        # because they (esp. newlines among them) make the report look untidy
+        node_txt = re.sub (r'^\s+', r'', node_txt)
+        node_txt = re.sub (r'\s+$', r'', node_txt)
+        txt += node_txt
         if txt and txt[-1] != '\n':
           txt += '\n'
       txt = re.sub (r'"', r'\\"', txt)
