mailtb.py: Reworded error_page, more serious and in English-language. default tip
authorPascal Volk <user@localhost.localdomain.org>
Fri, 20 Nov 2009 05:08:46 +0000
changeset 5 610fe1138532
parent 4 bc4d326e5a46
mailtb.py: Reworded error_page, more serious and in English-language. Added global error_page_is_xhtml variable.
mailtb.py
--- a/mailtb.py	Wed Nov 18 18:40:06 2009 +0000
+++ b/mailtb.py	Fri Nov 20 05:08:46 2009 +0000
@@ -20,23 +20,22 @@
 
 error_page = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
   <head>
     <title>Internal Server Error</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   </head>
   <body>
     <h1>Internal Server Error</h1>
-    <p>So wie es aussieht, ging bei der Bearbeitung Ihrer Anfrage etwas
-    schief.</p>
-    <p>Sofern Sie den Fehler verursacht haben, dürfen Sie jetzt ein schlechtes
-    Gewissen haben.<br />
-    Die Administration wird sich bei nächster Gelegenheit um das Problem
-    kümmern. Bitte haben Sie dafür etwas Verständnis.</p>
+    <p>The server encountered an internal error and was unable to complete your
+    request.</p>
+    <p>The administration team will take care of this problem. We apologize
+    for any inconvenience.</p>
     <h2>Error 500</h2>
-    <p>Sorry</p>
+    <p>Server got itself in trouble</p>
   </body>
 </html>"""
+error_page_is_xhtml = True
 msg_body = """Hi,
 
 an uncaught exception has occurred. The details are as follows:
@@ -118,8 +117,9 @@
     sys.stdout.flush()
 
 def send_error_page():
-    send_header(500, True)
-    print error_page
+    send_header(500, error_page_is_xhtml)
+    sys.stdout.write(error_page)
+    sys.stdout.flush()
 
 def send_mail(info):
     global config