[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/VFS - VFSResponse.py:1.1.4.2

Shane Hathaway shane@cvs.zope.org
Wed, 24 Apr 2002 11:38:44 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Publisher/VFS
In directory cvs.zope.org:/tmp/cvs-serv6450/VFS

Modified Files:
      Tag: Zope-3x-branch
	VFSResponse.py 
Log Message:
(Hopefully) better handling of exceptions


=== Zope3/lib/python/Zope/Publisher/VFS/VFSResponse.py 1.1.4.1 => 1.1.4.2 ===
     """VFS response
     """
+    __slots__ = (
+        '_exc',
+        )
 
     def setBody(self, body):
         """Sets the body of the response
@@ -30,7 +33,6 @@
            not be just a astring, but any Python object.
         """
         
-        # XXX: Handle exceptions
         self._body = body
 
 
@@ -41,17 +43,14 @@
 
     def getResult(self):
         """ """
+        if getattr(self, '_exc', None) is not None:
+            raise self._exc[0], self._exc[1]
         return self._getBody()
 
 
     def handleException(self, exc_info):
         """
         """
-        t, value = exc_info[:2]
-
-        import traceback
-        traceback.print_tb(exc_info[2])
-        print t
-        print value
-
-        self.setBody(value)
+        self._exc = exc_info[:2]
+        #import traceback
+        #traceback.print_exc()