[Zope-DB] Re: Zope/Plone, interbase, and blob fields

Chris Withers chris at simplistix.co.uk
Thu Sep 8 03:45:37 EDT 2005


Ashley wrote:
> When trying to execute this from an external method, Plone just freezes - no
> errors, it just freezes.

PDB is your friend...

> The external method is defined as follows:
> 
> def updateEntityNotes(self,notes,entKey):
     import pdb
     pdb.set_trace()
>   try:
>     dbCon = gvib.connect(theDB, userName, userPass)
>     cur=dbCon.cursor()
>     cur.execute("UPDATE ENTITY SET EN_NOTES=? WHERE
> EN_KEY=?",(notes,int(entKey)))
>     dbCon.commit()
>     return 'ok'
>   except:
>     return '<b>Error:</bSorry, your request could not be processed
> correctly.<br'+str(traceback.format_exception(sys.exc_type, sys.exc_value,
> sys.exc_traceback))

Bare excepts as you have above are a pretty bad idea, don't try and 
handle it like that, either catch specific exceptions you know about or 
leave standard_error_message to handle the lot...

PDB documentation can be found in the Documentation section of 
http://python.org in the "Module Index" section.

cheers,

Chris

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



More information about the Zope-DB mailing list