[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - ZopePublication.py:1.10

Jim Fulton jim@zope.com
Wed, 23 Oct 2002 12:00:51 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication
In directory cvs.zope.org:/tmp/cvs-serv8321/lib/python/Zope/App/ZopePublication

Modified Files:
	ZopePublication.py 
Log Message:
Merging in the work done by Naveen and Rakesh on the
ErrorReportingService-branch branch.

There is now an error reporting service that works like the Zope 2.6
site error log. Yay!


=== Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py 1.9 => 1.10 ===
--- Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py:1.9	Thu Aug  1 14:42:17 2002
+++ Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py	Wed Oct 23 12:00:20 2002
@@ -15,7 +15,10 @@
 from types import StringType, ClassType
 from zLOG import LOG, ERROR, INFO
 
+from Zope.ComponentArchitecture import getService
+from Zope.ComponentArchitecture.Exceptions import ComponentLookupError
 from ZODB.POSException import ConflictError
+from Zope.ComponentArchitecture import getService
 
 from Zope.Publisher.DefaultPublication import DefaultPublication
 from Zope.Publisher.mapply import mapply
@@ -47,6 +50,8 @@
 # XXX Should this be imported here?
 from Transaction import get_transaction
 
+from Zope.App.ComponentArchitecture.NextService import queryNextService
+
 class RequestContainer:
     # TODO: add security assertion declaring access to REQUEST
 
@@ -170,11 +175,10 @@
     def afterCall(self, request):
         get_transaction().commit()
 
-    def handleException(self, request, exc_info, retry_allowed=1):
+    def handleException(self, object, request, exc_info, retry_allowed=1):
         try:
             # Abort the transaction.
             get_transaction().abort()
-
             # Delegate Unauthorized errors to the authentication service
             # XXX Is this the right way to handle Unauthorized?  We need
             # to understand this better.
@@ -185,6 +189,11 @@
                 request.response.handleException(exc_info)
                 return
 
+            try:
+                errService = getService(object,'ErrorReportingService')
+                errService.raising(exc_info, request)
+            except ComponentLookupError:
+                pass
 
             # XXX This is wrong. Should use getRequstView:
             #