Skip to content

Commit

Permalink
fix: Add error handling for repo cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
ALiersEL committed May 19, 2024
1 parent 650c813 commit c79d0f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions swebench/harness/context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,10 @@ def __enter__(self):
# Clone github per repo/version
repo_path = os.path.join(self.testbed, env_name)
if not os.path.exists(repo_path):
clone_repo(repo, repo_path)
self.log.write(f"Cloned {repo} to {repo_path}")
if clone_repo(repo, repo_path):
self.log.write(f"Cloned {repo} to {repo_path}")
else:
raise Exception(f"Failed to clone {repo} to {repo_path}")
else:
self.log.write(f"Repo for {repo_prefix} version {version} exists: {repo_path}; skipping")

Expand Down

0 comments on commit c79d0f2

Please sign in to comment.