24 lines
588 B
Python
24 lines
588 B
Python
from flask import Blueprint, render_template
|
|
|
|
error_bp = Blueprint('error', __name__)
|
|
|
|
@error_bp.route('/error')
|
|
def error_page():
|
|
"""
|
|
Generic error page
|
|
"""
|
|
return render_template('error.html', message="An error occurred.")
|
|
|
|
@error_bp.app_errorhandler(404)
|
|
def page_not_found(e):
|
|
"""
|
|
Handle 404 errors
|
|
"""
|
|
return render_template('error.html', message="Page not found."), 404
|
|
|
|
@error_bp.app_errorhandler(500)
|
|
def internal_server_error(e):
|
|
"""
|
|
Handle 500 errors
|
|
"""
|
|
return render_template('error.html', message="Internal server error."), 500 |