1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-10-07 14:15:14 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Add error report

This commit is contained in:
sunnylqm
2021-10-24 16:19:17 +08:00
parent 6dd71a36e8
commit 0cc96ee59c

View File

@@ -218,19 +218,30 @@ export async function downloadUpdate(options, eventListeners) {
originHash: currentVersion,
});
} catch (e) {
logger(e.message);
logger('diff error, try pdiff');
logger(`diff error: ${e.message}, try pdiff`);
try {
await Pushy.downloadPatchFromPackage({
updateUrl: options.pdiffUrl,
hash: options.hash,
});
} catch (e) {
progressHandler && progressHandler.remove();
report(options.hash, 'error');
return;
}
}
} else if (options.pdiffUrl) {
logger('downloading pdiff');
try {
await Pushy.downloadPatchFromPackage({
updateUrl: options.pdiffUrl,
hash: options.hash,
});
} catch (e) {
progressHandler && progressHandler.remove();
report(options.hash, 'error');
return;
}
} else if (options.pdiffUrl) {
logger('downloading pdiff');
await Pushy.downloadPatchFromPackage({
updateUrl: options.pdiffUrl,
hash: options.hash,
});
}
setLocalHashInfo(options.hash, {
name: options.name,