You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(sqlalchemy): atomic decorator must preserve logic exceptions #571
Problem: the atomic decorator is supposed to be a unit-of-work boundary, but _handle_db_exception converts every non-SQLAlchemy exception to InternalError. A swallowed default nested failure also raises DatabaseTransactionError with no cause, so the caller loses the original logic error type and details.
Fix: map only SQLAlchemyError to Database*Error; re-raise BaseError and every other exception unchanged. Store the first exception from a nested savepoint=False failure and re-raise it at the outer boundary after the rollback, instead of raising DatabaseTransactionError. DatabaseTransactionError stays for genuine SQLAlchemy transaction failures. Savepoint mode already re-raises the inner error to its caller.
Checklist
map only SQLAlchemy failures; re-raise logic exceptions unchanged
store and re-raise the original nested failure at the outer boundary
Activity
github-actions commentedon Nov 2, 2026
Merged #572: fix(sqlalchemy): preserve logic exceptions in atomic blocks