mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-16 06:49:09 +02:00
try to fix repo access
This commit is contained in:
@@ -272,6 +272,21 @@ export async function getRepositoryFromGitHub(opt: {
|
||||
).data;
|
||||
} catch (error) {
|
||||
span.recordException(error as Error);
|
||||
if (
|
||||
error instanceof Error &&
|
||||
error.message.includes(
|
||||
"organization has enabled OAuth App access restrictions"
|
||||
)
|
||||
) {
|
||||
throw new AnonymousError("repo_access_limited", {
|
||||
httpStatus: 403,
|
||||
object: {
|
||||
owner: opt.owner,
|
||||
repo: opt.repo,
|
||||
},
|
||||
cause: error as Error,
|
||||
});
|
||||
}
|
||||
throw new AnonymousError("repo_not_found", {
|
||||
httpStatus: (error as any).status,
|
||||
object: {
|
||||
|
||||
Reference in New Issue
Block a user