Exception handling for database queries
This commit is contained in:
@@ -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('')
|
||||
|
Reference in New Issue
Block a user