From 954993cca85a90a1d2868a9852b685824686952e Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Fri, 13 Sep 2024 15:46:27 +0300 Subject: Define new blueprint for all gn_docs. --- gn2/wqflask/api/markdown.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gn2/wqflask/api') diff --git a/gn2/wqflask/api/markdown.py b/gn2/wqflask/api/markdown.py index f0f94b52..9a43ecdb 100644 --- a/gn2/wqflask/api/markdown.py +++ b/gn2/wqflask/api/markdown.py @@ -29,6 +29,7 @@ news_blueprint = Blueprint("news_blueprint", __name__) xapian_syntax_blueprint = Blueprint("xapian_syntax_blueprint", __name__) blogs_blueprint = Blueprint("blogs_blueprint", __name__) +gn_docs_blueprint = Blueprint("gn_docs_blueprint", __name__) def fetch_raw_markdown(file_path): @@ -243,3 +244,12 @@ def blogs_list(): blogs = get_blogs() return render_template("blogs_list.html", blogs=blogs) + + +@gn_docs_blueprint.errorhandler(requests.exceptions.HTTPError) +def page_not_found(error): + """ Return error 404 """ + return {"Reason": error.response.reason, + "error_status_code": error.response.status_code, + "error_msg": error.response.text + } -- cgit v1.2.3