Skip to content

Commit

Permalink
Skip import of missing files.
Browse files Browse the repository at this point in the history
Handle the previous export failure as gracefully as we can.

Refs greasemonkey#2966
  • Loading branch information
arantius committed Jun 7, 2018
1 parent 99499df commit b582ae8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/content/backup/import.js
Expand Up @@ -115,13 +115,21 @@ async function fillDownloaderFromZipFolder(

let requires = {};
parsedDetails.requireUrls.forEach(u => {
requires[u] = zip.file(urlMap[u]).async('text');
try {
requires[u] = zip.file(urlMap[u]).async('text');
} catch (e) {
console.warn('Could not load from backup zip, will attempt download:', u);
}
});
downloader.setKnownRequires(requires);

let resources = {};
Object.values(parsedDetails.resourceUrls).forEach(u => {
resources[u] = zip.file(urlMap[u]).async('blob');
try {
resources[u] = zip.file(urlMap[u]).async('blob');
} catch (e) {
console.warn('Could not load from backup zip, will attempt download:', u);
}
});
downloader.setKnownResources(resources);

Expand Down

0 comments on commit b582ae8

Please sign in to comment.