Hello,

I was wondering if there is a special reason to wrap the db api 
exceptions like e.g. "IntegrityError" into an SQLError.

The code could execute self._autorollback() and just rise the 
exception again. 

This would make much nicer exception handling (at least for me) in 
situations like 

    ...
    session.flush()
except IntegrityError, integrity_error:
    # handle error

instread of

    session.flush()
except SQLError, e:
    if (e.orig.pgcode == 23505): # handle 1
    if (e.orig.pgcode == xxxxx): # etc


Tom

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to