Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
severinsimmler committed Apr 17, 2018
1 parent 023e846 commit e92fb31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion application/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def index():
Renders the main page. A warning pops up, if the machine is not
connected to the internet.
"""
raise werkzeug.exceptions.MethodNotAllowed
if application.utils.is_connected():
return flask.render_template('index.html')
else:
Expand Down Expand Up @@ -56,6 +55,10 @@ def model():

@app.errorhandler(werkzeug.exceptions.HTTPException)
def handle_http_exception(e):
"""
Handles any HTTP Exception, shows a Bootstrap modal with the error
message and renders the index.html again.
"""
return flask.render_template('index.html', http='error', error_message=e)

for code in werkzeug.exceptions.default_exceptions:
Expand Down

0 comments on commit e92fb31

Please sign in to comment.