Hi
My app saves data in a method with "@transaction.commit_manually".
My code had a bug - a field in a model was the wrong datatype for what
was passed in, so I got a DataError exception back.
However, the only exception that was displayed to me was
"psycopg2.InternalError: current transaction is aborted, commands
ignored until end of transaction block".
I had to comment out "@transaction.commit_manually" in order to get
the real DataError exception to show.
My code looks like this:
@transaction.commit_manually
def save(self):
try:
# save data here
except BaseException as e:
traceback.print_exc() # prints
psycopg2.InternalError traceback
transaction.rollback()
else:
transaction.commit()
I'm sure there's a way to get the original, DataError, exception...
can anyone help?
Thanks,
Darren
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---