- Initialize
tx = None before the try block
- Add check
tx is not None in the exception handler
- Add a catch-all except
Exception as e: clause for full coverage
- Update the consumer methods to properly catch the new
Exception if not already in place
Found 10 usage instances: https://github.com/search?q=repo%3Ahubmapconsortium%2Fentity-api%20tx.rollback()&type=code