Re: [Zope-dev] Pointless exception re-raising in DA.py

2004-03-25 Thread Chris Withers
Clemens Robbenhaar wrote: Ok, if this is the proper dance to catch such exceptions with Zope without risking ZODB corruption I will go with it. So far I have not been sure, that ConflictError is the only type needing special treatement in these cases. Well, the PROPER dance would be to only catch

Re: [Zope-dev] Pointless exception re-raising in DA.py

2004-03-25 Thread Chris Withers
Dieter Maurer wrote: try: DB__=dbc() except: exc_type, exc_value, trc = sys.exc_info() raise DatabaseError('%s is not connected to a database' % self.id, exc_type, exc_value), trc I didn't know you could re-raise a traceback like

Re: [Zope-dev] Pointless exception re-raising in DA.py

2004-03-25 Thread Andrew Bennetts
On Thu, Mar 25, 2004 at 10:23:27AM +, Chris Withers wrote: Dieter Maurer wrote: try: DB__=dbc() except: exc_type, exc_value, trc = sys.exc_info() raise DatabaseError('%s is not connected to a database' % self.id, exc_type,

[Zope-dev] Pointless exception re-raising in DA.py

2004-03-24 Thread Chris Withers
Hi All, In Shared/DC/ZRDB/DA.py, Line 399 of Zope 2.6.1 and line 419 in 2.7.0, there's this rather pointless lump of code: try: DB__=dbc() except: raise DatabaseError, ( '%s is not connected to a database' % self.id) ...which only serves to mask the real cause of the

[Zope-dev] Pointless exception re-raising in DA.py

2004-03-24 Thread Clemens Robbenhaar
Hi Chris, In Shared/DC/ZRDB/DA.py, Line 399 of Zope 2.6.1 and line 419 in 2.7.0, there's this rather pointless lump of code: try: DB__=dbc() except: raise DatabaseError, ( '%s is not connected to a database' % self.id) ...which only serves to

Re: [Zope-dev] Pointless exception re-raising in DA.py

2004-03-24 Thread Chris Withers
Hi there, Clemens Robbenhaar wrote: I remeber I made a collector issue about that liens of code: http://www.zope.org/Collectors/Zope/927 Indeed. Catching everything and raising a string exception is evil, and I was glad to see that go. Previously this has been a string valued exception.

Re: [Zope-dev] Pointless exception re-raising in DA.py

2004-03-24 Thread Clemens Robbenhaar
Hi Chris, [...] ...this is an application level decision. The code currently makes it very easy, but at the expense of debugging any unexpected exceptions that code throws. While relational data may be optional for you, for many people it is ESSENTIAL, and is used for things like

Re: [Zope-dev] Pointless exception re-raising in DA.py

2004-03-24 Thread Dieter Maurer
Chris Withers wrote at 2004-3-24 15:36 +: ... The reason is that I would like to treat errors when accessing an external data base different from other errors; often the data obtained there is only optional to the page, so I don't want to show usered the error page in this case, only to