Update error handling to work with werkzeug 2

Closes: #1
This commit is contained in:
Edward Betts 2023-09-29 18:03:39 +01:00
parent 1a479dacbc
commit 0ff82e1c05
2 changed files with 25 additions and 19 deletions

View file

@ -7,24 +7,17 @@
{% block content %}
<div class="p-2">
<h1>Software error: {{ tb.exception_type }}</h1>
<h1>Software error: {{ exception_type }}</h1>
<div>
<pre>{{ tb.exception }}</pre>
<pre>{{ exception }}</pre>
</div>
{% set body %}
URL: {{ request.url }}
{{ tb.plaintext | safe }}
{% endset %}
<p><a class="btn btn-primary btn-lg" role="button" href="https://github.com/EdwardBetts/dab-mechanic/issues/new?title={{ tb.exception + " " + request.url | urlencode }}&body={{ body | urlencode }}">Submit as an issue on GitHub</a> (requires an account with GitHub)</p>
<h2 class="traceback">Traceback <em>(most recent call last)</em></h2>
{{ tb.render_summary(include_title=False) | safe }}
{{ summary | safe }}
<p>Error in function "{{ last_frame.f_code.co_name }}": {{ last_frame_args | pprint }}</p>
<pre>{{ last_frame.f_locals | pprint }}</pre>
<p>Error in function "{{ last_frame.function_name }}": {{ last_frame_args | pprint }}</p>
<pre>{{ last_frame.locals | pprint }}</pre>
</div>
{% endblock %}