From 9560196c029183c673a14928e4061f5078260c5d Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 4 Jun 2021 00:48:02 +0530 Subject: handled 404 and 500 --- app/views/error_pages.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/views/error_pages.py (limited to 'app/views') diff --git a/app/views/error_pages.py b/app/views/error_pages.py new file mode 100644 index 0000000..b0db7f7 --- /dev/null +++ b/app/views/error_pages.py @@ -0,0 +1,10 @@ +from app import app +from flask import render_template + +@app.errorhandler(404) +def page_not_found(e): + return render_template('message.html',code=404,message="Whoops! Page Not Found"), 404 + +@app.errorhandler(500) +def page_server_error(e): + return render_template("message.html",code=500,message="Server Could Not Process This."), 500 \ No newline at end of file -- cgit v1.2.3