While working with a form, I tried to intercept an exception when a
record is created that violates a unique constraint.

While expecting this:

psycopg.ProgrammingError: ERROR:  duplicate key violates unique
constraint "reviewer_association_ui"

Insert ...

I got this:

ProgrammingError: ERROR:  current transaction is aborted, commands
ignored until end of transaction block

Select ...

TG seemed to skip over the first exception and not throw anything until
it ran into a second exception in a differnt control block.

My code looks something like:

try:
    Assocation(**data)
except e:
    # handle error

What's happening here?

Randall

Reply via email to