[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ErrorReportingService - ErrorReportingService.py:1.8

Naveen P pnaveen@zeomega.com
Mon, 11 Nov 2002 08:08:15 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ErrorReportingService
In directory cvs.zope.org:/tmp/cvs-serv28544

Modified Files:
	ErrorReportingService.py 
Log Message:
Removed bare except: clauses.


=== Zope3/lib/python/Zope/App/OFS/Services/ErrorReportingService/ErrorReportingService.py 1.7 => 1.8 ===
--- Zope3/lib/python/Zope/App/OFS/Services/ErrorReportingService/ErrorReportingService.py:1.7	Mon Nov 11 03:56:45 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/ErrorReportingService/ErrorReportingService.py	Mon Nov 11 08:08:14 2002
@@ -69,12 +69,6 @@
     # Exceptions that happen all the time, so we dont need
     # to log them. Eventually this should be configured
     # through-the-web.
-    def _makestr(self, dictionary):
-        retVal = ''
-        for each in dictionary.keys():
-            retVal = retVal +str(each)+' : '+str(dictionary[each])+'<br> '
-        return retVal
-    
     def raising(self, info, request=None):
         """Log an exception.
         Called by ZopePublication.handleException method.
@@ -109,17 +103,12 @@
                                            request.user.getTitle(),
                                            request.user.getDescription()
                                            )
-                    # XXX bare except clause. Why is this here?
-                    # There should be a comment explaining why a bare
-                    # except clause is the right thing in this situation.
-                    except:
+                    #Incase of unauthorized access handle the AttributeError silently.
+                    except AttributeError:
                         pass
-                    try:
-                        req_html = self._makestr(request)
-                    # XXX bare except clause. Why is there here?
-                    except:
-                        pass
-                    
+
+                    req_html = ''.join(['%s : %s<br>' % item for item in request.items()])
+
                 try:
                     strv = str(info[1])
                 # XXX bare except clause. Why is this here?