damned-lies r811 - trunk



Author: claudep
Date: Fri Mar 21 18:50:07 2008
New Revision: 811
URL: http://svn.gnome.org/viewvc/damned-lies?rev=811&view=rev

Log:
2008-03-21  Claude Paroz  <claude 2xlibre net>

	* dispatcher.py: Added error handling code, to not display entire
	traceback in case of error. Fixes #523633.
	* gnome-modules.xml.in: Added comment to gail module.

Modified:
   trunk/ChangeLog
   trunk/dispatcher.py
   trunk/gnome-modules.xml.in

Modified: trunk/dispatcher.py
==============================================================================
--- trunk/dispatcher.py	(original)
+++ trunk/dispatcher.py	Fri Mar 21 18:50:07 2008
@@ -54,7 +54,10 @@
             self.request = self.request[:-4]
             self.render('xml')
         else:
-            self.render('html')
+            try:
+                self.render('html')
+            except Exception, e:
+                self.render_html_error(e)
 
     def render(self, type='html', parameter=None):
         if type=='xml':
@@ -74,6 +77,17 @@
         global utils
         if type == 'html':
             print utils.TemplateInspector(tmpl)
+    
+    def render_html_error(self, err):
+        print "Content-type: text/html; charset=UTF-8\n"
+        print "<html><head><title>Damned Lies error</title><link rel='stylesheet' href='%s/data/layout.css'/></head>\n" % defaults.webroot
+        print "<body><div id='header'><h1>Damned Lies</h1><p>&nbsp;</p></div>"
+        print "<div id='content'><p>Sorry, an error occurred while processing the Web page.</p>\n"
+        print "<p>Error: %s</p>" % str(err)
+        if defaults.DEBUG:
+            print "<pre>%s</pre>" % traceback.format_exc()
+        print "<p>Return to <a href='%s'>Home page</a></p>" % defaults.webroot
+        print "</div></body></html>"
 
 class RequestMapper:
     def __init__(self, base='/'):

Modified: trunk/gnome-modules.xml.in
==============================================================================
--- trunk/gnome-modules.xml.in	(original)
+++ trunk/gnome-modules.xml.in	Fri Mar 21 18:50:07 2008
@@ -391,6 +391,7 @@
     <branch id="HEAD"/>
   </module>
   <module id="gail">
+    <_comment>From GNOME 2.23, GAIL is integrated into GTK+. Don't commit in trunk any more.</_comment>
     <branch id="HEAD" stringfrozen="false"/>
     <branch id="gnome-2-18" stringfrozen="true"/>
     <branch id="gnome-2-20" stringfrozen="true"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]