Merge pull request #1798 from yueliu1999/develop

Catch exception of repository clone
This commit is contained in:
Richard Beales
2023-04-16 06:59:20 +01:00
committed by GitHub

View File

@@ -16,5 +16,8 @@ def clone_repository(repo_url: str, clone_path: str) -> str:
str: The result of the clone operation"""
split_url = repo_url.split("//")
auth_repo_url = f"//{CFG.github_username}:{CFG.github_api_key}@".join(split_url)
git.Repo.clone_from(auth_repo_url, clone_path)
return f"""Cloned {repo_url} to {clone_path}"""
try:
git.Repo.clone_from(auth_repo_url, clone_path)
return f"""Cloned {repo_url} to {clone_path}"""
except Exception as e:
return f"Error: {str(e)}"