Generalise exception handling
This commit is contained in:
@@ -133,7 +133,7 @@ def redirect_if_started(function):
|
||||
id = session.get('id')
|
||||
try:
|
||||
if request.method == 'GET' and id and Entry.query.filter_by(id=id).first(): return redirect(url_for('quiz._quiz'))
|
||||
except (SQLAlchemyError, ConnectionError) as exception:
|
||||
except Exception as exception:
|
||||
write('system.log', f'Database error when checking if test has been started: {exception}')
|
||||
return abort(500)
|
||||
return function(*args, **kwargs)
|
||||
|
Reference in New Issue
Block a user