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

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 сервера
*/
let response = await fetch(`${updateServerRef.current}/updates/get?app=${APP_VERSION}&kernel=${CORE_VERSION}&arch=${APPLICATION_ARCH}&platform=${APPLICATION_PLATFROM}`);
if(response.status != 200){
error("Failed to check for updates: " + response.statusText);
let response = await fetch
(`${updateServerRef.current}/updates/get?app=${APP_VERSION}&kernel=${CORE_VERSION}&arch=${APPLICATION_ARCH}&platform=${APPLICATION_PLATFROM}`).catch((e) => {
error("Failed to check for updates: " + e.message);
});
if(!response || response.status != 200){
error("Failed to check for updates, SDU unavailable");
return;
}
let updateInfo : UpdateServerResponse = await response.json();