Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
made a temporal route for pytest error route
  • Loading branch information
taka-rl authored Oct 14, 2024
1 parent 73a4a31 commit 8849557
Showing 1 changed file with 33 additions and 26 deletions.
59 changes: 33 additions & 26 deletions flask_app/routes/errors.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
from flask import Blueprint, render_template
from flask_app.utils import with_translations


errors_bp = Blueprint('errors', __name__)


# 404 Not Found
@errors_bp.app_errorhandler(404)
@with_translations
def not_found(error):
return render_template('404.html'), 404


# 403 Forbidden
@errors_bp.app_errorhandler(403)
@with_translations
def forbidden(error):
return render_template('403.html'), 403


# 500 Internal Server Error
@errors_bp.app_errorhandler(500)
@with_translations
def server_error(error):
return render_template('500.html'), 500
from flask import Blueprint, render_template
from flask_app.utils import with_translations


errors_bp = Blueprint('errors', __name__)


# 404 Not Found
@errors_bp.app_errorhandler(404)
@with_translations
def not_found(error):
return render_template('404.html'), 404


# 403 Forbidden
@errors_bp.app_errorhandler(403)
@with_translations
def forbidden(error):
return render_template('403.html'), 403


# 500 Internal Server Error
@errors_bp.app_errorhandler(500)
@with_translations
def server_error(error):
return render_template('500.html'), 500


# temporal route for testing 500 errors
@errors_bp.route('/trigger-500')
@with_translations
def trigger_500():
return render_template('500.html'), 500

0 comments on commit 8849557

Please sign in to comment.