Skip to content

Commit 09fe976

Browse files
committed
Use ValueError exceptions
1 parent ae7a8bb commit 09fe976

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guarddog/scanners/github_action_scanner.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ def _get_repo(self, url: str) -> str:
3535
parsed_url = urlparse(url)
3636

3737
if parsed_url.hostname and parsed_url.hostname != "github.com":
38-
raise Exception(parsed_url)
38+
raise ValueError("Invalid GitHub repo URL: " + url)
3939

4040
path = parsed_url.path.removesuffix(".git").strip("/")
4141

4242
if path.count("/") != 1:
43-
raise Exception("Invalid GitHub repo URL: " + url)
43+
raise ValueError("Invalid GitHub repo name: " + path)
4444

4545
return path
4646

0 commit comments

Comments
 (0)