lint: excuse catching broad exceptions
This commit is contained in:
parent
9797d8d119
commit
fce594bbc4
2 changed files with 9 additions and 3 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue