Jaymon / prom

A PostgreSQL or SQLite orm for Python
MIT License
22 stars 4 forks source link

with transaction() converts all errors to InterfaceErrors #2

Closed Jaymon closed 10 years ago

Jaymon commented 10 years ago

this is unexpected behavior and it should be changed to only change the specific interfaces (psycopg2, sqlite) to InterfaceError and leave everything else untouched

try:
    with interface.transaction():
        raise StopIteration() # this will be converted to an InterfaceError
except StopIteration:
    pass # this will never be triggered