[Zope] Re: Transactions in Zope?

Chris Withers chrisw@nipltd.com
Mon, 26 Nov 2001 06:01:24 +0000


Bruce Eckel wrote:
> 
> >try this:
> >
> >         except smtplib.SMTPSenderRefused:
> >             get_transaction().abort()
> >             return "Invalid email address: please press your"
> >                    "browser's 'back' key and correct it"

Actually, just thought about this...

Probably the 'correct' way to do all this is to not catch the exception but to
modify your standard_error_message to display the right thing when this
exception is encountered. That way, IIRC, Zope will take care of aborting the
transaction for you.

cheers,

Chris