Обработка ошибки обновлений
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user