lint: excuse catching broad exceptions

This commit is contained in:
Iain Learmonth 2022-05-17 09:03:43 +01:00
parent 9797d8d119
commit fce594bbc4
2 changed files with 9 additions and 3 deletions

View file

@ -68,7 +68,9 @@ def impot(model: db.Model) -> None:
db.session.add(x)
db.session.commit()
logging.info("Import completed successfully")
except Exception as e:
# Many things can go wrong in the above, like IO, format or database errors.
# We catch all the errors and ensure the database transaction is rolled back, and log it.
except Exception as e: # pylint: disable=broad-except
logging.exception(e)
db.session.rollback()