mercredi 30 décembre 2015

Getting more info form python sqlite exceptions

I'm using python's builtin sqlite3 DB API.

While inserting objects to my DB tables, following sqlite exception raised:

"PRIMARY KEY must be unique"

Exception got caught in main() by except Exception as e:, so it's only info I've got.

I would want to know in which table insertion failed, value that failed, etc...

What's the right way to get the most info from sqlite exceptions?

Thanks

Aucun commentaire:

Enregistrer un commentaire