Include connection errors in exception handling
This commit is contained in:
@@ -27,7 +27,7 @@ def create_app():
|
||||
@login_manager.user_loader
|
||||
def _load_user(id):
|
||||
try: return User.query.filter_by(id=id).first()
|
||||
except SQLAlchemyError as exception:
|
||||
except (SQLAlchemyError, ConnectionError) as exception:
|
||||
write('system.log', f'Database error when loading user fo login manager: {exception}')
|
||||
return abort(500)
|
||||
|
||||
|
Reference in New Issue
Block a user