mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-17 10:37:19 +02:00
wip handle empty repo
This commit is contained in:
@@ -92,10 +92,11 @@ export default class GitHubStream extends GitHubBase implements SourceBase {
|
|||||||
recursive: "1",
|
recursive: "1",
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error, error.status);
|
|
||||||
if (error.status == 409) {
|
if (error.status == 409) {
|
||||||
return {};
|
console.log(error.stack);
|
||||||
}
|
// empty tree
|
||||||
|
ghRes = { data: { tree: [], truncated: false } };
|
||||||
|
} 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", {
|
||||||
httpStatus: error.status,
|
httpStatus: error.status,
|
||||||
@@ -107,6 +108,7 @@ export default class GitHubStream extends GitHubBase implements SourceBase {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const tree = this.tree2Tree(ghRes.data.tree, truncatedTree, parentPath);
|
const tree = this.tree2Tree(ghRes.data.tree, truncatedTree, parentPath);
|
||||||
if (ghRes.data.truncated) {
|
if (ghRes.data.truncated) {
|
||||||
@@ -154,7 +156,6 @@ export default class GitHubStream extends GitHubBase implements SourceBase {
|
|||||||
this.tree2Tree(ghRes.data.tree, truncatedTree, parentPath);
|
this.tree2Tree(ghRes.data.tree, truncatedTree, parentPath);
|
||||||
return truncatedTree;
|
return truncatedTree;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error, error.status);
|
|
||||||
if (error.status == 409) {
|
if (error.status == 409) {
|
||||||
}
|
}
|
||||||
return truncatedTree;
|
return truncatedTree;
|
||||||
|
|||||||
Reference in New Issue
Block a user