Skip to content

Commit

Permalink
format the error page template
Browse files Browse the repository at this point in the history
  • Loading branch information
rosado committed Jan 9, 2025
1 parent 44ffec6 commit a476ad4
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions src/views/errorPages/error.njk
Original file line number Diff line number Diff line change
Expand Up @@ -43,34 +43,36 @@
</div>
</div>

<div class="govuk-grid-row">
{% if env !== 'production' and err.statusCode !== 404 %}
{% if env !== 'production' and err.statusCode !== 404 %}
<div class="govuk-grid-row">

<details class="govuk-body">
<summary>Error details</summary>
<pre class="govuk-body-s" style="overflow-x: scroll; max-width: 100%; line-height: 1.5;">
{{ err.stack | safe }}
</pre>
{% if err.cause %}
<p><strong>Cause:</strong></p>
<pre class="govuk-body-s" style="overflow-x: scroll; max-width: 100%; line-height: 1.5;">
{{ err.cause.stack | safe }}
</pre>
{% endif %}
</details>

{% set issues = (err.cause | schemaIssues) %}
{% if issues.length > 0 %}
<details class="govuk-body">
<summary>Error details</summary>
<pre class="govuk-body-s" style="overflow-x: scroll; max-width: 100%; line-height: 1.5;">
{{ err.stack | safe }}
</pre>
{% if err.cause %}
<p><strong>Cause:</strong></p>
<pre class="govuk-body-s" style="overflow-x: scroll; max-width: 100%; line-height: 1.5;">
{{ err.cause.stack | safe }}
</pre>
{% endif %}
<summary>Schema Issues</summary>
{% for issue in issues %}
<div class="schema-issue">
<p><strong>Path</strong>: [{{ issue.path.join(', ') }}]</p>
<p><strong>Message:</strong>: {{ issue.message }}</p>
</div>
{% endfor %}
</details>

{% set issues = (err.cause | schemaIssues) %}
{% if issues.length > 0 %}
<details class="govuk-body">
<summary>Schema Issues</summary>
{% for issue in issues %}
<div class="schema-issue">
<p><strong>Path</strong>: [{{ issue.path.join(', ') }}]</p>
<p><strong>Message:</strong>: {{ issue.message }}</p>
</div>
{% endfor %}
</details>

{% endif %}
{% endif %}
</div>
</div>
{% endif %}

{% endblock %}

0 comments on commit a476ad4

Please sign in to comment.