mirror of
https://github.com/kennethreitz/records.git
synced 2026-06-05 23:00:20 +00:00
Fix transaction context manager to re-raise exceptions after rollback
The except block was swallowing exceptions silently after rolling back the transaction. Added `raise` to propagate the exception to the caller. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -343,6 +343,7 @@ class Database(object):
|
||||
tx.commit()
|
||||
except:
|
||||
tx.rollback()
|
||||
raise
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user