[Zope3-checkins] SVN: Zope3/branches/srichter-twisted-integration/src/zope/app/wsgi/__init__.py Implemented post-mortem WSGI-application, so that Jim can be happy and

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Apr 18 16:10:28 EDT 2005


Log message for revision 30028:
  Implemented post-mortem WSGI-application, so that Jim can be happy and 
  debug broken requests. :-)
  
  

Changed:
  U   Zope3/branches/srichter-twisted-integration/src/zope/app/wsgi/__init__.py

-=-
Modified: Zope3/branches/srichter-twisted-integration/src/zope/app/wsgi/__init__.py
===================================================================
--- Zope3/branches/srichter-twisted-integration/src/zope/app/wsgi/__init__.py	2005-04-18 20:04:51 UTC (rev 30027)
+++ Zope3/branches/srichter-twisted-integration/src/zope/app/wsgi/__init__.py	2005-04-18 20:10:27 UTC (rev 30028)
@@ -92,6 +92,9 @@
         if db is not None:
             self.requestFactory = factory(db)
 
+    def publish(self, request):
+        publish(request)
+
     def __call__(self, environ, start_response):
         """See zope.app.wsgi.interfaces.IWSGIApplication"""
         # wsgiOutput has two purposes: (1) it is the response headers output
@@ -114,3 +117,18 @@
         # since the response is written using the WSGI ``write()`` callable
         # return an empty iterable (see PEP 333).
         return ""
+
+
+class PMDBWSGIPublisherApplication(WSGIPublisherApplication):
+
+    def publish(self, request):
+        try:
+            publish(request, handle_errors=False)
+        except:
+            import sys, pdb
+            print "%s:" % sys.exc_info()[0]
+            print sys.exc_info()[1]
+            pdb.post_mortem(sys.exc_info()[2])
+            raise
+
+    



More information about the Zope3-Checkins mailing list