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