Except MySQL error

Daniel Yoo dyoo at hkn.eecs.berkeley.edu
Mon Jun 21 18:09:27 EDT 2004


Florian Lindner <Florian.Lindner at xgm.de> wrote:

: I want to except the error which is raised in MySQLdb module when one is
: trying to insert a value in a primary key column which already exists. But
: I don't know which error to except...


Hi Florian,


According to the Python Database API:

    http://www.python.org/peps/pep-0249.html

you can expect a subclass of IntegrityError.


Hope this helps!



More information about the Python-list mailing list