1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-11-02 06:13:11 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

throw error

This commit is contained in:
sunnylqm
2024-07-24 17:06:49 +08:00
parent 3355751bd5
commit 454fc28c08
3 changed files with 33 additions and 5 deletions

View File

@@ -37,6 +37,7 @@ export class Pushy {
checkStrategy: 'both',
logger: noop,
debug: false,
throwError: false,
};
lastChecking?: number;
@@ -289,6 +290,7 @@ export class Pushy {
}
let succeeded = false;
this.report({ type: 'downloading' });
let lastError: any;
const diffUrl = (await testUrls(diffUrls)) || _diffUrl;
if (diffUrl) {
log('downloading diff');
@@ -300,6 +302,7 @@ export class Pushy {
});
succeeded = true;
} catch (e: any) {
lastError = e;
if (__DEV__) {
succeeded = true;
} else {
@@ -317,6 +320,7 @@ export class Pushy {
});
succeeded = true;
} catch (e: any) {
lastError = e;
if (__DEV__) {
succeeded = true;
} else {
@@ -334,6 +338,7 @@ export class Pushy {
});
succeeded = true;
} catch (e: any) {
lastError = e;
if (__DEV__) {
succeeded = true;
} else {
@@ -349,10 +354,14 @@ export class Pushy {
return hash;
}
if (!succeeded) {
return this.report({
this.report({
type: 'errorUpdate',
data: { newVersion: hash },
});
if (lastError) {
throw lastError;
}
return;
}
log('downloaded hash:', hash);
setLocalHashInfo(hash, {