aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/api
diff options
context:
space:
mode:
authorAlexander_Kabui2024-09-13 15:46:27 +0300
committerAlexander_Kabui2024-09-13 15:46:27 +0300
commit954993cca85a90a1d2868a9852b685824686952e (patch)
treec52ac18ce7460c832ec97880e7f326be53784c68 /gn2/wqflask/api
parent904957b017179d530c60f4b231a26cc2b8747987 (diff)
downloadgenenetwork2-954993cca85a90a1d2868a9852b685824686952e.tar.gz
Define new blueprint for all gn_docs.
Diffstat (limited to 'gn2/wqflask/api')
-rw-r--r--gn2/wqflask/api/markdown.py10
1 files changed, 10 insertions, 0 deletions
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
+ }