From 95b6d8a884e9d9881fa2a2de19e2f1cd71c41ff5 Mon Sep 17 00:00:00 2001 From: Caleb Date: Mon, 5 Mar 2018 16:31:05 -0700 Subject: [PATCH] Fix collection failure if entry fails. (#1093) --- src/backends/github/implementation.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backends/github/implementation.js b/src/backends/github/implementation.js index 19947dd3..91003584 100644 --- a/src/backends/github/implementation.js +++ b/src/backends/github/implementation.js @@ -72,13 +72,15 @@ export default class GitHub { sem.take(() => this.api.readFile(file.path, file.sha).then((data) => { resolve({ file, data }); sem.leave(); - }).catch((err) => { + }).catch((err = true) => { 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.