From 3574998f5f7c41e946610730638fd7e3fecb5835 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 24 Feb 2014 18:34:17 -0500 Subject: Use cherrypy handlers to render error pages Replaces custom code to render 401 Unauthorized page as well as adds 400 and 500 handlers Signed-off-by: Simo Sorce --- templates/badrequest.html | 12 ++++++++++++ templates/internalerror.html | 15 +++++++++++++++ templates/unauthorized.html | 8 ++++++-- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 templates/badrequest.html create mode 100644 templates/internalerror.html (limited to 'templates') diff --git a/templates/badrequest.html b/templates/badrequest.html new file mode 100644 index 0000000..25a2731 --- /dev/null +++ b/templates/badrequest.html @@ -0,0 +1,12 @@ +{% extends "master.html" %} +{% block main %} +
+

400 - Bad Request

+ {% if message: %} +

{{ message }}

+ {% else %} +

Your client made a request that could not be understood.

+

Sorry!

+ {% endif %} +
+{% endblock %} diff --git a/templates/internalerror.html b/templates/internalerror.html new file mode 100644 index 0000000..9682c14 --- /dev/null +++ b/templates/internalerror.html @@ -0,0 +1,15 @@ +{% extends "master.html" %} +{% block main %} +
+

500 - Internal Server Error

+ {% if message: %} +

{{ message }}

+ {% else %} +

Ipsilon encountered an unexpected internal error while trying to + fulfill your request.

+ {% endif %} +

Please retry again.

+

If the error persists, contact the server administrator to resolve + the problem.

+
+{% endblock %} diff --git a/templates/unauthorized.html b/templates/unauthorized.html index ee2f412..cdb34da 100644 --- a/templates/unauthorized.html +++ b/templates/unauthorized.html @@ -2,7 +2,11 @@ {% block main %}

401 - Unauthorized

-

Authentication was not successful

+ {% if message: %} +

{{ message }}

+ {% else %} +

Authentication was not successful

+ {% endif %}

Try to login again

-{% endblock %} \ No newline at end of file +{% endblock %} -- cgit