summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-02-24 18:34:17 -0500
committerSimo Sorce <simo@redhat.com>2014-02-24 20:30:06 -0500
commit3574998f5f7c41e946610730638fd7e3fecb5835 (patch)
treeaf0fc74cd1ed071b66006f44ec5817b17e87ba09 /templates
parentf7070919e1350f784f639fd2054eab80384abeea (diff)
downloadipsilon-3574998f5f7c41e946610730638fd7e3fecb5835.tar.gz
ipsilon-3574998f5f7c41e946610730638fd7e3fecb5835.tar.xz
ipsilon-3574998f5f7c41e946610730638fd7e3fecb5835.zip
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 <simo@redhat.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/badrequest.html12
-rw-r--r--templates/internalerror.html15
-rw-r--r--templates/unauthorized.html8
3 files changed, 33 insertions, 2 deletions
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 %}
+<div class="col-sm-12">
+ <h1>400 - Bad Request</h1>
+ {% if message: %}
+ <p>{{ message }}</p>
+ {% else %}
+ <p>Your client made a request that could not be understood.</p>
+ <p>Sorry!</p>
+ {% endif %}
+</div>
+{% 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 %}
+<div class="col-sm-12">
+ <h1>500 - Internal Server Error</h1>
+ {% if message: %}
+ <p>{{ message }}</p>
+ {% else %}
+ <p>Ipsilon encountered an unexpected internal error while trying to
+ fulfill your request.</p>
+ {% endif %}
+ <p>Please retry again.</p>
+ <p>If the error persists, contact the server administrator to resolve
+ the problem.</p>
+</div>
+{% 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 %}
<div class="col-sm-12">
<h1>401 - Unauthorized</h1>
- <p>Authentication was not successful</p>
+ {% if message: %}
+ <p>{{ message }}</p>
+ {% else %}
+ <p>Authentication was not successful</p>
+ {% endif %}
<p><a href="{{ basepath }}/login" title="Login">Try to login again</a></p>
</div>
-{% endblock %} \ No newline at end of file
+{% endblock %}