Skip to content

Commit

Permalink
Use ValueError exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
juliendoutre committed Feb 5, 2025
1 parent ae7a8bb commit 09fe976
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions guarddog/scanners/github_action_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def _get_repo(self, url: str) -> str:
parsed_url = urlparse(url)

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

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

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

return path

Expand Down

0 comments on commit 09fe976

Please sign in to comment.