Skip to content

Commit c7ca71a

Browse files
committed
add error message with name of offending repo
1 parent 83a1265 commit c7ca71a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ccos/teams/set_codeowners.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# Third-party
99
import git
10+
from github.GithubException import UnknownObjectException
1011

1112
# First-party/Local
1213
from ccos.gh_utils import (
@@ -108,7 +109,11 @@ def check_and_fix_repo(args, organization, repo_name, teams, temp_dir):
108109

109110
LOG.info(f"Checking and fixing {repo_name}...")
110111
repo_dir = os.path.join(temp_dir, repo_name)
111-
gh_repo = organization.get_repo(repo_name)
112+
try:
113+
gh_repo = organization.get_repo(repo_name)
114+
except UnknownObjectException:
115+
LOG.error(f"Repository not found: {repo_name}")
116+
raise
112117
clone_url = get_github_repo_url_with_credentials(repo_name)
113118
local_repo = set_up_repo(clone_url, repo_dir)
114119
codeowners_path = Path(os.path.join(repo_dir, ".github", "CODEOWNERS"))

0 commit comments

Comments
 (0)