mirror of
https://github.com/wasrusgen/zov-tech.git
synced 2026-06-03 15:04:50 +00:00
fix: selfmeasure — читаемое сообщение при HTTP 4xx/5xx
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
78e332dd95
commit
e71ac3a5a8
@ -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("Сервер не отвечает");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user