diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-07 13:59:24 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-07 13:59:24 +0530 |
commit | 11a2e1c778cf4b2ea958b6bdd7868c8604d45df2 (patch) | |
tree | 1db1b387a4d0f34831b6e88aeced59c89e604cd6 /app/views/error_pages.py | |
parent | 3a708b304319afe84ebf3d40ecebabe6acc339f3 (diff) |
added docstrings
Diffstat (limited to 'app/views/error_pages.py')
-rw-r--r-- | app/views/error_pages.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/views/error_pages.py b/app/views/error_pages.py index 1f066cc..ef40163 100644 --- a/app/views/error_pages.py +++ b/app/views/error_pages.py @@ -1,14 +1,25 @@ +# -*- coding: utf-8 -*- +""" +This file describes the errors and the message the user should see. +""" + from app import app from flask import render_template @app.route("/Simulate500") def simulate_500(): + """ + Used to simulate a error 500 for test coverage of 500 handling + """ return 500 @app.errorhandler(403) def page_forbidden(e): + """ + Thrown when a user accesses a page with @flask_login.login_required + """ return ( render_template( "message.html", code=403, message="Forbidden. You shall not pass" @@ -19,6 +30,9 @@ def page_forbidden(e): @app.errorhandler(404) def page_not_found(e): + """ + Page for resource or file nout found + """ return ( render_template("message.html", code=404, message="Whoops! Page Not Found"), 404, @@ -27,6 +41,9 @@ def page_not_found(e): @app.errorhandler(500) def page_server_error(e): + """ + Page for internal server error + """ return ( render_template( "message.html", code=500, message="Server Could Not Process This." |