Nick wrote:
> Actually it would be nice if psycopg actually raised meaningful
> exceptions rather than OperationalError for every damn thing.
Here, here. Gerhard has been putting in changes, and it does raise
IntegrityErrors now too.
But, the real problem lies in the DB-API's silence on more detailed,
cross-DB error messages. I ran into this problem a few months back when
I was trying to write some reasonably DB independent code. Using simple
SQL would generally do the trick, but since there were no standard
exceptions to give detailed errors (e.g., foreign key constraint
violation versus duplicate key insertion), I crashed and burned.
...Edmund.
|