--- loncom/interface/lonerrorhandler.pm	2005/07/08 21:21:56	1.8
+++ loncom/interface/lonerrorhandler.pm	2006/03/21 18:33:39	1.10
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Internal Server Error Handler
 #
-# $Id: lonerrorhandler.pm,v 1.8 2005/07/08 21:21:56 www Exp $
+# $Id: lonerrorhandler.pm,v 1.10 2006/03/21 18:33:39 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -42,15 +42,9 @@ sub handler {
 
     &Apache::loncommon::get_posted_cgi($r);
 
-    my $html=&Apache::lonxml::xmlbegin();
-    my $bodytag=&Apache::loncommon::bodytag($env{'form.sendinfo'}?'Sending Error Report':'Could Not Process Request');
-	$r->print(<<ENDHEADER);
-$html
-<head>
-<title>The LearningOnline Network with CAPA</title>
-</head>
-$bodytag
-ENDHEADER
+    my $title = $env{'form.sendinfo'} ? 'Sending Error Report'
+                                      : 'Could Not Process Request';
+    $r->print(&Apache::loncommon::start_page($title));
 
     if ($env{'form.sendinfo'}) {
 	my $repro='no';
@@ -78,7 +72,7 @@ ENDMESSAGE
 	    $r->dir_config('lonSysEMail'); 
 
         &Apache::lonmsg::sendemail($recipients,'ERROR REPORT',$message);
-	$r->print('<h2>Report submitted</h2>Thank you!</body></html>');
+	$r->print('<h2>Report submitted</h2>Thank you!');
     } else {
 # ------------------------------------------------------------- Get environment
 	my $envkey;
@@ -132,12 +126,12 @@ Internal info:
 $syllabus
 </pre>
 </font>
-</body>
-</html>
 ENDDOCUMENT
 # -------------------------- Better terminate this in case something was sticky
+
         $r->child_terminate();
     }
+    $r->print(&Apache::loncommon::end_page());
     return OK;
 }