Exception handling for database queries

This commit is contained in:
2022-08-20 10:56:43 +01:00
parent b8fd65d856
commit 866c9b10cf
15 changed files with 234 additions and 114 deletions

View File

@@ -8,8 +8,7 @@ import sys
from getpass import getpass
with app.app_context():
try:
users = User.query.all()
try: users = User.query.all()
except SQLAlchemyError as exception:
sys.exit('Database error:', exception)
print('')