mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-10-07 17:25:13 +08:00
Add error report
This commit is contained in:
27
lib/main.js
27
lib/main.js
@@ -218,19 +218,30 @@ export async function downloadUpdate(options, eventListeners) {
|
|||||||
originHash: currentVersion,
|
originHash: currentVersion,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger(e.message);
|
logger(`diff error: ${e.message}, try pdiff`);
|
||||||
logger('diff error, 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({
|
await Pushy.downloadPatchFromPackage({
|
||||||
updateUrl: options.pdiffUrl,
|
updateUrl: options.pdiffUrl,
|
||||||
hash: options.hash,
|
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, {
|
setLocalHashInfo(options.hash, {
|
||||||
name: options.name,
|
name: options.name,
|
||||||
|
Reference in New Issue
Block a user