Skip to content

Commit

Permalink
Merge pull request #356 from codecov/dana/404-gitlab-groups
Browse files Browse the repository at this point in the history
add try catch block to catch any 404 errors that come from gitlab
  • Loading branch information
dana-yaish authored Feb 28, 2023
2 parents a8000ad + f594435 commit 57abd15
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions shared/torngit/gitlab.py
Original file line number Diff line number Diff line change
@@ -389,13 +389,18 @@ async def list_repos(self, username=None, token=None):
token=token,
)
else:
repos = await self.api(
"get",
"/groups/{}/projects?per_page=50&page={}".format(
group["id"], page
),
token=token,
)
try:
repos = await self.api(
"get",
"/groups/{}/projects?per_page=50&page={}".format(
group["id"], page
),
token=token,
)
except TorngitClientError as e:
if e.code == 404:
log.warning(f"Group with id {group['id']} does not exist")
repos = []
for repo in repos:
(
owner_service_id,

0 comments on commit 57abd15

Please sign in to comment.