fix: selfmeasure — читаемое сообщение при HTTP 4xx/5xx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wasrusgen 2026-05-18 14:49:53 +03:00
parent 78e332dd95
commit e71ac3a5a8

View File

@ -20,6 +20,7 @@ const SelfMeasureScreen = (function () {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ initData: tg?.initData || "", initDataUnsafe: tg?.initDataUnsafe || null, ...body }), body: JSON.stringify({ initData: tg?.initData || "", initDataUnsafe: tg?.initDataUnsafe || null, ...body }),
}); });
if (!res.ok) throw new Error(`Ошибка сервера (${res.status})`);
return await res.json(); return await res.json();
} catch (e) { } catch (e) {
if (e.name === "AbortError") throw new Error("Сервер не отвечает"); if (e.name === "AbortError") throw new Error("Сервер не отвечает");