Skip to content

Commit 819f3fd

Browse files
committed
validate repo lookup
1 parent 8dceec8 commit 819f3fd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libkernelbot/launchers/github.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
RunResult,
3333
SystemInfo,
3434
)
35-
from libkernelbot.utils import setup_logging
35+
from libkernelbot.utils import KernelBotError, setup_logging
3636

3737
from .launcher import Launcher
3838

@@ -174,7 +174,10 @@ class GitHubArtifact:
174174
class GitHubRun:
175175
def __init__(self, repo: str, token: str, branch: str, workflow_file: str):
176176
gh = Github(token)
177-
self.repo = gh.get_repo(repo)
177+
try:
178+
self.repo = gh.get_repo(repo)
179+
except UnknownObjectException as e:
180+
raise KernelBotError(f"Could not find GitHub repository {repo}: 404") from e
178181
self.token = token
179182
self.branch = branch
180183
self.workflow_file = workflow_file

0 commit comments

Comments
 (0)