Fix collection failure if entry fails. (#1093)
This commit is contained in:
parent
1647d0b8e5
commit
95b6d8a884
@ -72,13 +72,15 @@ export default class GitHub {
|
|||||||
sem.take(() => this.api.readFile(file.path, file.sha).then((data) => {
|
sem.take(() => this.api.readFile(file.path, file.sha).then((data) => {
|
||||||
resolve({ file, data });
|
resolve({ file, data });
|
||||||
sem.leave();
|
sem.leave();
|
||||||
}).catch((err) => {
|
}).catch((err = true) => {
|
||||||
sem.leave();
|
sem.leave();
|
||||||
reject(err);
|
console.error(`failed to load file from GitHub: ${file.path}`);
|
||||||
|
resolve({ error: err });
|
||||||
}))
|
}))
|
||||||
)));
|
)));
|
||||||
});
|
});
|
||||||
return Promise.all(promises);
|
return Promise.all(promises)
|
||||||
|
.then(loadedEntries => loadedEntries.filter(loadedEntry => !loadedEntry.error));
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fetches a single entry.
|
// Fetches a single entry.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user