Randall wrote:
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?
I hate to be Captain Obvious, but shouldn't except read something like
except Exception, e
Is Assocation by any chance a controller method with parameter tg_errors?
Cheers,
Simon