Make admin and API errors visible and traceable

Return structured JSON errors with request IDs, log unexpected exceptions with tracebacks, and show HTTP and network failures in the admin UI without losing unsaved source.

Preserve publication errors when release listing also fails, handle cancelled preview promises, and add regression tests, browser failure scenarios, and updated API documentation.
This commit is contained in:
2026-11-13 09:55:55 +03:00
parent 88ac95dd19
commit 231490bb7c
19 changed files with 1714 additions and 67 deletions
@@ -2,6 +2,7 @@
{% block title %}Публикация — админка{% endblock %}
{% block content %}
<h1>Публикация</h1>
{% if error|default(none) %}<ul class='issues' role='alert'><li class='error'>{{ error.message }}<br>Код: <code>{{ error.code }}</code> · ID запроса: <code>{{ error.request_id }}</code></li></ul>{% endif %}
{% if issues %}
<h2>Проблемы сборки</h2>
<ul class='issues'>{% for i in issues %}<li class='{{ i.severity }}'><code>{{ i.code }}</code> {{ i.path }} {{ i.message }}</li>{% endfor %}</ul>
@@ -25,7 +26,7 @@
</form>{% endif %}</td>
</tr>
{% else %}
<tr><td colspan='2'>Релизов пока нет</td></tr>
<tr><td colspan='2'>{% if releases_unavailable|default(false) %}Список релизов недоступен. Обновите страницу после устранения ошибки.{% else %}Релизов пока нет{% endif %}</td></tr>
{% endfor %}
</tbody>
</table>