From 11a2e1c778cf4b2ea958b6bdd7868c8604d45df2 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Mon, 7 Jun 2021 13:59:24 +0530 Subject: added docstrings --- app/views/error_pages.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app/views/error_pages.py') 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." -- cgit v1.2.3