mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-09 07:07:50 +02:00
fix: handle empty repo
This commit is contained in:
@@ -93,9 +93,11 @@ export default class GitHubStream extends GitHubBase implements SourceBase {
|
|||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.status == 409) {
|
if (error.status == 409) {
|
||||||
console.log(error.stack);
|
|
||||||
// empty tree
|
// empty tree
|
||||||
ghRes = { data: { tree: [], truncated: false } };
|
if (this.repository.status != "ready")
|
||||||
|
await this.repository.updateStatus("ready");
|
||||||
|
// cannot be empty otherwise it would try to download it again
|
||||||
|
return { __: {} };
|
||||||
} else {
|
} else {
|
||||||
await this.repository.resetSate("error", "repo_not_accessible");
|
await this.repository.resetSate("error", "repo_not_accessible");
|
||||||
throw new AnonymousError("repo_not_accessible", {
|
throw new AnonymousError("repo_not_accessible", {
|
||||||
|
|||||||
Reference in New Issue
Block a user