From: Ian B. <ia...@co...> - 2005-11-15 16:46:57
|
Heberto del Rio wrote: > Hi, I am new to SQLObject, can someone tell me what can of > Exceptions are raised by SQLObject when something goes wrong > in the DBMS side, like trying to insert two records with the > same unique field, etc > > I have looked through the documentation and is not there. I > tried to look in the code without success. Mostly it's the database's exceptions, like psycopg.IntegrityError. If you need to be database agnostic you can catch obj._connection.module.IntegrityError -- but different databases/drivers often send different exceptions for the same errors. The DB-API PEP defines the exceptions: http://www.python.org/peps/pep-0249.html -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |