[Zope] SQL errors

Dieter Maurer dieter@handshake.de
Fri, 29 Sep 2000 23:55:49 +0200 (CEST)


Andy McKay writes:
 > Using ZODBC Database Adapter to connect to an MSSQL and I can call the sql
 > method in dtml eg:
 > 
 > <dtml-try>
 >   <dtml-call "SQL_add_user(REQUEST)">
 > <dtml-except sql.error>
 >     Error!
 > </dtml-try>
 > 
 > But does anyone know a way of trapping the specific error eg: database down,
 > key violation etc...? Or do I have to hack ZODBC to return different errors?
You know the "error_value" variable defined inside the "dtml-except"?

Maybe, it can give you additional information about the kind
of error.
If it is the wrong one, reraise the exception.


Dieter