Show error message if precompiled PDF cannot be opened

If PDF files have a validation error which means that they can't be
opened by PyPDF2 we would previously show the 500 status error page. We
now catch PyPDF2.utils.PdfReadErrors so that we can display a custom
error message on the notification page instead.
This commit is contained in:
Katie Smith
2019-01-08 17:34:57 +00:00
parent bb7e9726d3
commit da50f77538
3 changed files with 57 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
{% extends "withnav_template.html" %}
{% block service_page_title %}
Letter
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">Letter</h1>
<p>
Provided as PDF on {{ created_at|format_datetime_short }}
</p>
<p class="notification-status-cancelled">
Couldnt read this file
</p>
{% endblock %}