Skip to content

Commit e35e891

Browse files
feedback
1 parent f7c31be commit e35e891

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

packages/backend/src/ee/accountPermissionSyncer.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ export class AccountPermissionSyncer {
206206
},
207207
},
208208
});
209-
throw error;
210209
}
210+
throw error;
211211
}
212212
}
213213

@@ -254,21 +254,7 @@ export class AccountPermissionSyncer {
254254
// @note: we only care about the private repos since we don't need to build a mapping
255255
// for public repos.
256256
// @see: packages/web/src/prisma.ts
257-
let githubRepos;
258-
try {
259-
githubRepos = await getReposForAuthenticatedUser(/* visibility = */ 'private', octokit);
260-
} catch (error) {
261-
if (error && typeof error === 'object' && 'status' in error) {
262-
const status = (error as { status: number }).status;
263-
if (status === 401 || status === 403) {
264-
throw new Error(
265-
`GitHub API returned ${status} error. Your token may have expired or lacks the required permissions. ` +
266-
`Please re-authorize with GitHub to grant the necessary access.`
267-
);
268-
}
269-
}
270-
throw error;
271-
}
257+
const githubRepos = await getReposForAuthenticatedUser(/* visibility = */ 'private', octokit);
272258
const gitHubRepoIds = githubRepos.map(repo => repo.id.toString());
273259

274260
const repos = await this.db.repo.findMany({

0 commit comments

Comments
 (0)