web: Add error details for bug reports

This commit is contained in:
Franciszek Stachura 2024-09-27 15:37:43 +02:00 committed by Théo Lebrun
parent 76d13c9193
commit 46254c4a90
3 changed files with 11 additions and 0 deletions

View file

@ -84,6 +84,7 @@ def get_project_error_page(req, resp, exception: ElixirProjectError):
'referer': req.referer if req.referer != req.uri else None, 'referer': req.referer if req.referer != req.uri else None,
'bug_report_link': get_github_issue_link(report_error_details), 'bug_report_link': get_github_issue_link(report_error_details),
'report_error_details': report_error_details,
'error_title': exception.title, 'error_title': exception.title,
} }
@ -147,6 +148,7 @@ def get_error_page(req, resp, exception: ElixirProjectError):
'referer': req.referer, 'referer': req.referer,
'bug_report_link': ADD_ISSUE_LINK + parse.quote(report_error_details), 'bug_report_link': ADD_ISSUE_LINK + parse.quote(report_error_details),
'report_error_details': report_error_details,
'error_title': exception.title, 'error_title': exception.title,
} }

View file

@ -668,6 +668,9 @@ h2 {
margin: 0; margin: 0;
} }
#report-error-details-header {
color: gray;
}
/* ident */ /* ident */

View file

@ -21,6 +21,12 @@
<li><a class="link" href="{{ bug_report_link }}">Report a bug</a></li> <li><a class="link" href="{{ bug_report_link }}">Report a bug</a></li>
{%- endif %} {%- endif %}
</ul> </ul>
{% if report_error_details is not none -%}
<details>
<summary id="report-error-details-header">Error details for a bug report</summary>
<pre>{{ report_error_details }}</pre>
</details>
{% endif -%}
</div> </div>
{% endblock %} {% endblock %}