[Zope] ZSQL Catch Errors

Juan Manuel Ruiz García juanma at mailmadrid.com
Mon Dec 22 15:27:19 EST 2003


I'm using ZODBCA for my Access Database.

I need to catch the 'sql.error' exceptions returned by errors on this
connection. Now I get a page like this:
----------
Site Error
An error was encountered while publishing this resource.

Error Type: sql.error
Error Value: ('37000', -3502, '[Microsoft][Controlador ODBC Microsoft
Access] Error de sintaxis en la instrucci\xf3n INSERT INTO.')
----------

I need to know how to catch that error value from my python script (the one
which calls the zsql method), something like:

----
try:

salida=context.qReceptores(tabla='miTabla',columnas=columnas,valores=valores
)
except:
    WHAT CAN I DO TO GET THE VALUES OF THE ERROR??
----

Thanks in advance!

Juan Manuel




More information about the Zope mailing list