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

Chris Withers lists at simplistix.co.uk
Thu Mar 25 05:23:27 EST 2004


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 this... where's tha tsyntax 
documented?

> Define "DatabaseError" in such a way that its "__str__" includes
> information about the original exception.

This seems needlessly overcomplicated to me...

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk




More information about the Zope-Dev mailing list