Обработка ошибки обновлений

This commit is contained in:
RoyceDa
2026-02-12 14:03:03 +02:00
parent b38918cb6d
commit 938ce9ba73

View File

@@ -83,9 +83,12 @@ export function UpdateProvider(props: UpdateProviderProps) {
/** /**
* Запрашиваем обновления с SDU сервера * Запрашиваем обновления с SDU сервера
*/ */
let response = await fetch(`${updateServerRef.current}/updates/get?app=${APP_VERSION}&kernel=${CORE_VERSION}&arch=${APPLICATION_ARCH}&platform=${APPLICATION_PLATFROM}`); let response = await fetch
if(response.status != 200){ (`${updateServerRef.current}/updates/get?app=${APP_VERSION}&kernel=${CORE_VERSION}&arch=${APPLICATION_ARCH}&platform=${APPLICATION_PLATFROM}`).catch((e) => {
error("Failed to check for updates: " + response.statusText); error("Failed to check for updates: " + e.message);
});
if(!response || response.status != 200){
error("Failed to check for updates, SDU unavailable");
return; return;
} }
let updateInfo : UpdateServerResponse = await response.json(); let updateInfo : UpdateServerResponse = await response.json();