Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collection failure if entry fails. #1093

Merged
merged 7 commits into from
Mar 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/backends/github/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,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}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erquhart @Benaiah I added a console error for now, we can add a toast notification or other GUI action later.

resolve({ error: err });
}))
)));
});
return Promise.all(promises);
return Promise.all(promises)
.then(loadedEntries => loadedEntries.filter(loadedEntry => !loadedEntry.error));
};

// Fetches a single entry.
Expand Down