-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
made a temporal route for pytest error route
- Loading branch information
Showing
1 changed file
with
33 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |