Chris Withers wrote at 2004-3-24 15:36 +0000:
>> 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 fill up doem slot with
>> "sorry, that certain piece of information is not availabe, because our
>> sql data base sucks".
>...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.
You can have both!
It is just a little more work for you (I know you are lazy...):
exc_type, exc_value, trc = sys.exc_info()
raise DatabaseError('%s is not connected to a database' % self.id,
trc = None
Define "DatabaseError" in such a way that its "__str__" includes
information about the original exception.
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -