Much better error page
This commit is contained in:
parent
c1dcd33d82
commit
57182eb9a6
|
@ -2,24 +2,12 @@
|
|||
{% block big-links %}
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="col-lg-12">
|
||||
<div class="centering text-center">
|
||||
<div class="text-center">
|
||||
<h1><span class="text-danger">Error: {{status}}</span></h1>
|
||||
{% if status %}
|
||||
<h2>Error: {{status}}</h2>
|
||||
{% endif %}
|
||||
<hr>
|
||||
{% if title %}
|
||||
<h2 class="without-margin">{{title}}</h2>
|
||||
{% if error %}
|
||||
<p>{{error}}</p>
|
||||
{% endif %}
|
||||
{% if message %}
|
||||
<h4 class="text-danger">{{message}}</h4>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -113,6 +113,16 @@
|
|||
returns a response map with the error page as the body
|
||||
and the status specified by the status key"
|
||||
[error-details]
|
||||
(log/debug "Showing error page: " error-details)
|
||||
{:status (:status error-details)
|
||||
:headers {"Content-Type" "text/html; charset=utf-8"}
|
||||
:body (render "error.html" {} error-details)})
|
||||
:body (parser/render-file
|
||||
"error.html"
|
||||
(assoc
|
||||
error-details
|
||||
:site-title (:site-title env)
|
||||
:title
|
||||
(str "Apologies, we have a problem: "
|
||||
(:title error-details))
|
||||
:error (:message error-details)
|
||||
:message nil))})
|
||||
|
|
Loading…
Reference in a new issue