Skip to content

Commit

Permalink
refactor: error.html
Browse files Browse the repository at this point in the history
  • Loading branch information
alegarsan11 committed May 27, 2024
1 parent cb95690 commit 96b6683
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions nftables-frontend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import os
from service import create_default_user, login_manager

ERROR = 'error.html'

app = Flask(__name__)
app.register_blueprint(visualization_bp)
app.register_blueprint(creation_bp)
Expand All @@ -26,11 +28,11 @@

@app.errorhandler(404)
def page_not_found(e):
return render_template('error.html', message='Page not found'), 404
return render_template(ERROR, message='Page not found'), 404

@app.errorhandler(500)
def internal_error(e):
return render_template('error.html', message="Internal server error"), 500
return render_template(ERROR, message="Internal server error"), 500

@app.route('/favicon.ico')
def favicon():
Expand All @@ -57,11 +59,11 @@ def create_app():

@app.errorhandler(404)
def page_not_found(e):
return render_template('error.html', message='Page not found'), 404
return render_template(ERROR, message='Page not found'), 404

@app.errorhandler(500)
def internal_error(e):
return render_template('error.html', message="Internal server error"), 500
return render_template(ERROR, message="Internal server error"), 500

@app.route('/favicon.ico')
def favicon():
Expand Down

0 comments on commit 96b6683

Please sign in to comment.