Add a nicer response for TimeoutError

This commit is contained in:
Timotej Lazar 2023-07-07 10:15:02 +02:00
parent 6b72316076
commit dd607dbddd
6 changed files with 28 additions and 3 deletions

View file

@ -96,6 +96,8 @@ def create_app(test_config=None):
version = db.load('settings').get('version')
nodes = db.read('nodes')
return flask.render_template('nodes.html', version=version, nodes=nodes)
except TimeoutError:
return flask.render_template('busy.html')
except Exception as e:
return flask.Response(f'something went catastrophically wrong: {e}',
status=400, mimetype='text/plain')