[Zope-DB] SQL exception handling questions

Andrew Veitch andrew@logicalprogression.net
Mon, 17 Mar 2003 16:09:03 +0000


First off you need to import the exceptions:

Import psycopg

Then catch with something like:

try:
  result=self.sql.search(query)
except psycopg.IntegrityError:
  doSomething()

Hope that helps

Andrew