From 057842b7e6ecc6f8afe869f09b59b13c21763053 Mon Sep 17 00:00:00 2001 From: wasrusgen Date: Mon, 18 May 2026 00:21:28 +0300 Subject: [PATCH] =?UTF-8?q?debug:=20=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7=D1=8B?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D1=8C=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83?= =?UTF-8?q?=20=D0=B2=20=D0=BA=D0=B0=D1=80=D1=82=D0=BE=D1=87=D0=BA=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0=20=D0=B2=D0=BC=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=BE=20=D0=BF=D1=83=D1=81=D1=82=D0=BE=D0=B3=D0=BE?= =?UTF-8?q?=20=D1=8D=D0=BA=D1=80=D0=B0=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Обернуть renderClientHistory в try/catch — показывает текст ошибки - Добавить .catch() в mount() для перехвата unhandled promise rejection - Версия clients.js: 20260518c --- miniapp/assets/clients.js | 19 +++++++++++++++++-- miniapp/index.html | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/miniapp/assets/clients.js b/miniapp/assets/clients.js index ca10d9b..52300c7 100644 --- a/miniapp/assets/clients.js +++ b/miniapp/assets/clients.js @@ -29,7 +29,13 @@ const Clients = (function () { renderClientProposalsPage(clientKey); } else if (sub.startsWith("client/")) { const clientKey = decodeURIComponent(sub.slice(7)); - renderClientHistory(clientKey); + renderClientHistory(clientKey).catch(e => { + if (root) root.appendChild(el( + `
+ Ошибка карточки: ${escHtml(e.message)} +
` + )); + }); } else { renderList(); } @@ -565,7 +571,7 @@ const Clients = (function () { async function renderClientHistory(clientKey) { root.innerHTML = ""; root.appendChild(headerEl("Карточка клиента", "#/clients")); - + try { // Берём из кеша если есть let clients = clientsCache?.clients; if (!clients) { @@ -753,6 +759,15 @@ const Clients = (function () { proposalPlaceholder.replaceWith(propWrapper); // (управление перенесено наверх — сразу под шапку) + } catch (e) { + root.appendChild(el( + `
+ Ошибка загрузки карточки:
${escHtml(e.message)}
+ ${escHtml(e.stack ? e.stack.split('\n')[1] || '' : '')} +
` + )); + throw e; + } } /* ===================== Управление карточкой (edit / delete) ===================== */ diff --git a/miniapp/index.html b/miniapp/index.html index ef6dc66..604e0fb 100644 --- a/miniapp/index.html +++ b/miniapp/index.html @@ -39,7 +39,7 @@ - +